Cipher class final

An unauthenticated block-cipher mode fetched by name from the default provider, e.g. AES-256-CTR.

Constructors

Cipher.aesCtr(List<int> key)
AES in counter mode with a 128, 192 or 256-bit key, selected by the key length exactly like at_chops' AesCtrFactory.
factory
Cipher.named(String algorithm, List<int> key)
Any unauthenticated cipher EVP_CIPHER_fetch knows, e.g. AES-256-CBC, ChaCha20.
factory

Properties

algorithm → String
OpenSSL algorithm name, e.g. AES-256-CTR.
final
blockSize → int
Block size in bytes (1 for stream-like modes such as CTR).
no setter
hashCode → int
The hash code for this object.
no setterinherited
ivLength → int
Required IV/nonce length in bytes (16 for AES-CTR).
no setter
keyLength → int
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

decrypt(List<int> iv, List<int> ciphertext) → Uint8List
Decrypts ciphertext in one call.
decryptStream(List<int> iv) → CipherStream
encrypt(List<int> iv, List<int> plaintext) → Uint8List
Encrypts plaintext in one call. For CTR the output has the same length.
encryptStream(List<int> iv) → CipherStream
A streaming encryptor: call CipherStream.update repeatedly, then CipherStream.finish. Counter state carries across calls, so the concatenated output equals encrypt of the concatenated input.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited