Skip to main content

rind 0.2.0 copy "rind: ^0.2.0" to clipboard
rind: ^0.2.0 copied to clipboard

Fast, misuse-resistant cryptography for Dart and Flutter, through FFI to rind, a pure-Rust library: AEADs, hashes, HMAC, HKDF, PBKDF2, X25519, Ed25519, ECDSA, ECDH, RSA, and ML-KEM.

0.2.0 #

  • Breaking: ECDSA, Ed25519, and RSA each have a library, package:rind/ecdsa.dart, package:rind/ed25519.dart, and package:rind/rsa.dart, imported as ecdsa, as ed25519, and as rsa, each with a KeyPair and a PublicKey of its own, as rind 0.4's modules do, in place of one PublicKey for every algorithm. A public key's constructor takes the algorithm's own encoding and fromSpki a SubjectPublicKeyInfo, and toSpki lives only on the public key. A key pair's publicKey is the same object each time. Each library also exports RindException, which its calls throw, and the RindError its error holds.
  • Breaking: an RSA public key is bound to no algorithm: verify takes one, refusing a modulus below its floor, and modulusLength gives the modulus's length. RSA's signing algorithms are one class, rsa.SigningAlgorithm, whose pssSha256Salt and its SHA-384 and SHA-512 kin take a salt length, as rsa.VerificationAlgorithm's do.
  • Breaking: RSA-OAEP moves to package:rind/rsa.dart, and rsa.EncryptingKey(algorithm, der) takes PKCS#1 only, with rsa.EncryptingKey.fromSpki for a SubjectPublicKeyInfo.
  • Breaking: RSA's SHA-1 algorithms and modulus floors below 2048 bits move from package:rind/legacy.dart to package:rind/rsa_legacy.dart, imported as rsa beside package:rind/rsa.dart.
0.1 0.2
EcdsaKeyPair, EcdsaSigningAlgorithm ecdsa.KeyPair, ecdsa.SigningAlgorithm
Ed25519KeyPair ed25519.KeyPair
RsaKeyPair, RsaKeySize rsa.KeyPair, rsa.KeySize
RsaSigningAlgorithm.pkcs1Sha256 and the other constants rsa.SigningAlgorithm.pkcs1Sha256 and the others
RsaPssSigningAlgorithm.sha256(salt) and its kin, RsaSigningScheme rsa.SigningAlgorithm.pssSha256Salt(salt) and its kin
PublicKey(VerificationAlgorithm.ecdsaP256Sha256Asn1, point) and each ecdsa… constant ecdsa.PublicKey(ecdsa.VerificationAlgorithm.p256Sha256Asn1, point)
PublicKey(VerificationAlgorithm.ed25519, bytes) ed25519.PublicKey(bytes)
PublicKey(VerificationAlgorithm.rsaPkcs1Sha256, der), PKCS#1 or SPKI rsa.PublicKey(der), PKCS#1, or rsa.PublicKey.fromSpki(der)
PublicKey.fromSpki(algorithm, der) ecdsa.PublicKey.fromSpki(algorithm, der), ed25519.PublicKey.fromSpki(der), or rsa.PublicKey.fromSpki(der)
PublicKey.fromComponents(algorithm, n: n, e: e) rsa.PublicKey.fromComponents(n: n, e: e)
rsaPublicKey.verify(message, signature) rsaPublicKey.verify(algorithm, message, signature)
VerificationAlgorithm.rsaPkcs1Sha256 and each rsa… constant rsa.VerificationAlgorithm.pkcs1Sha256 and the others
RsaVerificationAlgorithm.pssSha256(salt) and its kin rsa.VerificationAlgorithm.pssSha256Salt(salt) and its kin
RsaKeyPair.publicKey(algorithm) rsa.KeyPair.publicKey
EcdsaKeyPair.toSpki(), Ed25519KeyPair.toSpki(), RsaKeyPair.toSpki(), RsaDecryptingKey.toSpki() publicKey.toSpki()
OaepAlgorithm, RsaDecryptingKey, RsaEncryptingKey rsa.OaepAlgorithm, rsa.DecryptingKey, rsa.EncryptingKey
RsaEncryptingKey(algorithm, der), PKCS#1 or SPKI rsa.EncryptingKey(algorithm, der), PKCS#1, or rsa.EncryptingKey.fromSpki(algorithm, der)
rsaPkcs1Sha1, rsaPkcs1Min1024Sha1 and the other floors, and oaepSha1, from package:rind/legacy.dart rsa.pkcs1Sha1, rsa.pkcs1Min1024Sha1 and the others, and rsa.oaepSha1, from package:rind/rsa_legacy.dart

0.1.1 #

  • The unauthenticated ciphers: AES-CBC (AesCbcEncryptingKey, AesCbcDecryptingKey, CbcIv), AES-CTR (AesCtr), and ChaCha20 (ChaCha20), sized by CipherAlgorithm.
  • AES-GCM under IVs of any length but zero (GcmKey, GcmIv), and RSA-PSS with a salt length of the caller's choosing (RsaPssSigningAlgorithm, which RsaKeyPair.sign and RsaKeyPair.publicKey now take as an RsaSigningScheme, and RsaVerificationAlgorithm.pssSha256 and its SHA-384 and SHA-512 kin).
  • rind wipes a key's native memory when Dart frees the key.
  • No call throws UnsupportedError for a missing CPU feature: rind runs on every CPU of each target it supports.
  • An RSA PublicKey whose modulus is below its algorithm's floor parses, and verify throws RindError.keyRejected.

0.1.0 #

  • rind's AEADs, digests, HMAC, HKDF, PBKDF2, key agreement, signatures, ML-KEM-768, and RSA-OAEP, through a prebuilt library the build hook downloads and checks against its pinned SHA-256, or built from source with the build_from_source user-define.
0
likes
140
points
408
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Fast, misuse-resistant cryptography for Dart and Flutter, through FFI to rind, a pure-Rust library: AEADs, hashes, HMAC, HKDF, PBKDF2, X25519, Ed25519, ECDSA, ECDH, RSA, and ML-KEM.

Repository (GitHub)
View/report issues
Contributing

Topics

#cryptography #crypto #ffi #encryption

License

unknown (license)

Dependencies

code_assets, crypto, ffi, hooks

More

Packages that depend on rind