ChaCha20Cipher class
ChaCha20 symmetric cipher implementation. Extends SymmetricCipher and provides ChaCha20 encryption/decryption.
- Inheritance
-
- Object
- ExpirationBase
- Cipher
- SymmetricCipher
- ChaCha20Cipher
- Annotations
-
- @includeInBarrelFile
Constructors
- ChaCha20Cipher(InputChaCha20Cipher input)
- Constructs a ChaCha20Cipher with the given input parameters.
Properties
- algorithm → CryptoAlgorithm
-
The cryptographic algorithm associated with this object.
no setteroverride
- expirationDate → DateTime?
-
The expiration date, or null if not set.
no setterinherited
- expirationTimes → int?
-
Maximum number of allowed usages before expiration.
no setterinherited
- expirationTimesRemaining → int?
-
Remaining number of allowed usages.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
The symmetric key as a string.
no setterinherited
- keyId → Digest
-
Returns the SHA-256 hash of the key material as a hex string.
no setterinherited
- nonce → Uint8List
-
Nonce used for ChaCha20 encryption/decryption.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
decrypt(
List< int> data) → List<int> -
Decrypts data using ChaCha20.
override
-
encrypt(
List< int> data) → List<int> -
Encrypts data using ChaCha20.
override
-
incrementUse(
) → void -
Increments the usage counter for expiration times.
inherited
-
isExpired(
) → bool -
Returns true if the object is expired.
inherited
-
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
Static Methods
-
createFull(
InputChaCha20Cipher input) → ChaCha20Cipher - Creates a ChaCha20Cipher with full control over all parameters.
-
generateKey(
) → String -
Generates a random 256-bit ChaCha20 key as a hex string.
override
-
generateNonce(
) → Uint8List - Generates a random 64-bit nonce for ChaCha20.