rind 0.2.0
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, andpackage:rind/rsa.dart, importedas ecdsa,as ed25519, andas rsa, each with aKeyPairand aPublicKeyof its own, as rind 0.4's modules do, in place of onePublicKeyfor every algorithm. A public key's constructor takes the algorithm's own encoding andfromSpkiaSubjectPublicKeyInfo, andtoSpkilives only on the public key. A key pair'spublicKeyis the same object each time. Each library also exportsRindException, which its calls throw, and theRindErroritserrorholds. - Breaking: an RSA public key is bound to no algorithm:
verifytakes one, refusing a modulus below its floor, andmodulusLengthgives the modulus's length. RSA's signing algorithms are one class,rsa.SigningAlgorithm, whosepssSha256Saltand its SHA-384 and SHA-512 kin take a salt length, asrsa.VerificationAlgorithm's do. - Breaking: RSA-OAEP moves to
package:rind/rsa.dart, andrsa.EncryptingKey(algorithm, der)takes PKCS#1 only, withrsa.EncryptingKey.fromSpkifor aSubjectPublicKeyInfo. - Breaking: RSA's SHA-1 algorithms and modulus floors below 2048 bits move
from
package:rind/legacy.darttopackage:rind/rsa_legacy.dart, importedas rsabesidepackage: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 byCipherAlgorithm. - AES-GCM under IVs of any length but zero (
GcmKey,GcmIv), and RSA-PSS with a salt length of the caller's choosing (RsaPssSigningAlgorithm, whichRsaKeyPair.signandRsaKeyPair.publicKeynow take as anRsaSigningScheme, andRsaVerificationAlgorithm.pssSha256and its SHA-384 and SHA-512 kin). - rind wipes a key's native memory when Dart frees the key.
- No call throws
UnsupportedErrorfor a missing CPU feature: rind runs on every CPU of each target it supports. - An RSA
PublicKeywhose modulus is below its algorithm's floor parses, andverifythrowsRindError.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_sourceuser-define.