encryptBytes static method
Cifra bytes e retorna um CryptEnvelope sem chave.
Implementation
static CryptEnvelope encryptBytes(
List<int> bytes, {
required Uint8List key,
CryptAlgorithm algorithm = CryptAlgorithm.chacha20Poly1305,
Uint8List? nonce,
List<int>? aad,
}) {
final legacy = _encryptViaAlgorithm(
bytes,
key: key,
algorithm: algorithm,
nonce: nonce,
aad: aad,
);
return CryptEnvelope(
algorithm: legacy.algorithm,
ciphertext: legacy.ciphertext,
nonce: legacy.nonce,
tag: legacy.tag,
aad: legacy.aad,
);
}