# crypto/encrypt — ChaCha20-Poly1305 AEAD ## Syntax
[crypto/encrypt :chacha20-poly1305 $key-hex $nonce-hex $plaintext ?$aad]
## Parameters - `:chacha20-poly1305` — Algorithm keyword (only one supported) - `$key-hex` — 32-byte key as 64 hex chars - `$nonce-hex` — 12-byte nonce as 24 hex chars - `$plaintext` — String to encrypt - `?$aad` — Optional AAD (covered by tag, not encrypted) ## Examples
[crypto/encrypt :chacha20-poly1305 $k $n "secret"]
## Returns `%Encrypted{ ciphertext "<hex>" tag "<hex>" }`, or `%Err{ message "..." }`. ## See Also `crypto/decrypt`, `crypto/rand-hex`, `crypto/hmac`