std/cipher
Authenticated encryption: ChaCha20Poly1305, the AEAD of RFC 8439 section 2.8, in TorbScript with no native. A key
of 32 bytes seals a message with a nonce of 12 bytes and any associated data, and opens it again only if neither the
message, the associated data, the nonce nor the tag changed. Sealing hides what a message says and the tag says who
made it; a digest (std/digest) does neither, and a signature (std/signature) is for a reader who holds no key.
ChaCha20 (section 2.4) and Poly1305 (section 2.5) are not exported from the package: nobody can use the cipher without its
tag, or the tag with a key that was used twice. CipherError says why a key or a nonce is not one, and that bytes
do not open.
Modules
std/cipher/aeadAEAD_CHACHA20_POLY1305 of RFC 8439 section 2.8: [ChaCha20Poly1305] seals a message under a key and a nonce, with associated data that is authenticated and not hidden, and opens it again.std/cipher/error[CipherError]: why a key or a nonce is not one, and why sealed bytes do not open.
Everything
- type
ChaCha20Poly1305A ChaCha20-Poly1305 key: exactly 32 bytes of the system's source of randomness. - type
CipherErrorWhy a key or a nonce has the wrong size, or why bytes do not open.