Upgrading encrypt 2 to 3
Breaking2.2.0 → 3.3.1Breaking1New6Changed1Fixed2Other1
BreakingUpgrade verdict
1 breaking change.
In plain terms
- The library now refuses to reuse the same initialization vector, which can break code that relied on doing so.
Must act 1 item needs code or config changes
Dart SDK requirement changed in 3.3.0: >=2.0.0 <3.0.0 → >=2.2.2 <3.0.0.
Adds clock ^1.0.1, crypto ^2.1.2.
Moves args ^1.5.1 → ^1.5.2. Your build may pick other versions.
What you must change
Breaking1
Enforces IV uniqueness, so reusing an initialization vector is no longer allowed.
API changes
Generated by DepDelta from published Dart source. Not mixed with prose notes.
- removed:
field AES.iv: final IV - removed:
field Salsa20.iv: final IV - changed:
ctor AES(this.key, this.iv, {this.mode = …, this.padding = …}) → ctor AES(this.key, {this.mode = …, this.padding = …}) - changed:
ctor RSA({this.publicKey, this.privateKey}) → ctor RSA({ this.publicKey, this.privateKey, this.isSignature = …, RSAEncoding encoding = …, }) - changed:
ctor Salsa20(this.key, this.iv) → ctor Salsa20(this.key) - changed:
method AES.decrypt(Encrypted encrypted): Uint8List → method AES.decrypt(Encrypted encrypted, {IV iv}): Uint8List - changed:
method AES.encrypt(Uint8List bytes): Encrypted → method AES.encrypt(Uint8List bytes, {IV iv}): Encrypted - changed:
method Algorithm.decrypt(Encrypted encrypted): Uint8List → method Algorithm.decrypt(Encrypted encrypted, {IV iv}): Uint8List - changed:
method Algorithm.encrypt(Uint8List bytes): Encrypted → method Algorithm.encrypt(Uint8List bytes, {IV iv}): Encrypted - changed:
method Encrypter.decrypt(Encrypted encrypted): String → method Encrypter.decrypt(Encrypted encrypted, {IV iv}): String - changed:
method Encrypter.decrypt16(String encoded): String → method Encrypter.decrypt16(String encoded, {IV iv}): String - changed:
method Encrypter.decrypt64(String encoded): String → method Encrypter.decrypt64(String encoded, {IV iv}): String - changed:
method Encrypter.encrypt(String input): Encrypted → method Encrypter.encrypt(String input, {IV iv}): Encrypted - changed:
method RSA.decrypt(Encrypted encrypted): Uint8List → method RSA.decrypt(Encrypted encrypted, {IV iv}): Uint8List - changed:
method RSA.encrypt(Uint8List bytes): Encrypted → method RSA.encrypt(Uint8List bytes, {IV iv}): Encrypted - changed:
method Salsa20.decrypt(Encrypted encrypted): Uint8List → method Salsa20.decrypt(Encrypted encrypted, {IV iv}): Uint8List - changed:
method Salsa20.encrypt(Uint8List bytes): Encrypted → method Salsa20.encrypt(Uint8List bytes, {IV iv}): Encrypted - added:
class Fernet implements Algorithm - added:
class SecureRandom - added:
ctor Fernet(Key b64key, {Clock clock}) - added:
ctor IV.fromSecureRandom(int length) - added:
ctor Key.fromSecureRandom(int length) - added:
ctor SecureRandom(int length) - added:
enum RSAEncoding - added:
field RSA.isSignature: final bool - added:
get SecureRandom.base16: String - added:
get SecureRandom.base64: String - added:
get SecureRandom.bytes: Uint8List - added:
get SecureRandom.length: int - added:
get SecureRandom.utf8: String - added:
member RSAEncoding.OAEP - added:
member RSAEncoding.PKCS1 - added:
method Encrypter.decryptBytes(Encrypted encrypted, {IV iv}): List<int> - added:
method Encrypter.encryptBytes(List<int> input, {IV iv}): Encrypted - added:
method Fernet.decrypt(Encrypted encrypted, {IV iv, int ttl}): Uint8List - added:
method Fernet.encrypt(Uint8List bytes, {IV iv}): Encrypted - added:
method Fernet.extractTimestamp(Uint8List data): int - added:
method Key.stretch(int desiredKeyLength, {int iterationCount = …, Uint8List salt}): Key - added:
set Encrypted.meta(Map m)
- added:
function parseKeyFromFile<T extends RSAAsymmetricKey>(String filename): Future<T>