SecretBox class

Encrypts a message with a key and a nonce and computes an authentication tag.

Constructors

SecretBox()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

decrypt(Uint8List cipherText, Uint8List nonce, Uint8List key) Uint8List
Verifies and decrypts a cipher text produced by encrypt.
decryptDetached(Uint8List cipher, Uint8List mac, Uint8List nonce, Uint8List key) Uint8List
Verifies and decrypts a detached cipher text and tag.
decryptString(Uint8List cipherText, Uint8List nonce, Uint8List key) String
Verifies and decrypts a cipher text produced by encrypt.
decryptStringDetached(Uint8List cipher, Uint8List mac, Uint8List nonce, Uint8List key) String
Verifies and decrypts a detached cipher text and tag.
encrypt(Uint8List value, Uint8List nonce, Uint8List key) Uint8List
Encrypts a message with a key and a nonce.
encryptDetached(Uint8List value, Uint8List nonce, Uint8List key) DetachedCipher
Encrypts a message with a key and a nonce, returning the encrypted message and authentication tag
encryptString(String value, Uint8List nonce, Uint8List key) Uint8List
Encrypts a string message with a key and a nonce.
encryptStringDetached(String value, Uint8List nonce, Uint8List key) DetachedCipher
Encrypts a string message with a key and a nonce, returning the encrypted message and authentication tag
randomKey() Uint8List
Generates a random key for use with secret key encryption.
randomNonce() Uint8List
Generates a random nonce for use with secret key encryption.