CryptoBox class

A class designed to encrypt and decrypt independent messages.

This class is compatible with libsodium's crypto_box construct. For more information, see libsodium documentation.

https://doc.libsodium.org/secret-key_cryptography/encrypted-messages

Constructors

CryptoBox()

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

cryptoBox({required Key recipientKey, required Key senderKey, required Uint8List message, required Uint8List nonce}) Uint8List
Encrypts a message into a crypto box with a given nonce.
open({required Key recipientKey, required Key senderKey, required Uint8List message, required Uint8List nonce}) Uint8List
Decrypts a message from a crypto box.
randomNonce() Uint8List
Generates a random nonce for use in a crypto box.
seal({required Key recipientKey, required Uint8List message}) Uint8List
Encrypts a message for a recipient using an ephemeral key and a deterministic nonce.
sealOpen({required Key recipientKey, required Uint8List ciphertext}) Uint8List
Decrypts a sealed crypto box.