Encrypt text with authenticated encryption

Protect bytes with the RFC 8439 ChaCha20-Poly1305 construction.

freeworks offlinenothing uploaded
ToolChaCha20-Poly1305 Encrypt
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

ChaCha20 generates a keystream from a 256-bit key and nonce, plaintext is XORed with it, and Poly1305 authenticates ciphertext plus additional data; the tag is appended. Verification requires the original nonce and key.

  • The IETF construction uses a 96-bit nonce and 128-bit tag.
  • Nonce uniqueness is required per key.

Worked example

Encrypt with ChaCha20
Encrypt a message using ChaCha20-Poly1305 authenticated encryption
Input
											Input: Top secret data
Key: MySecretKey123!
										
Output
												yDvmSBPD2nfyrFVN3jHjGLr8ZsL8WuUD8qOvqj6WRrUSJH+EPWiH8sP01m3sSmDZ1WFabxGWtT5kDYg=
											

When to use this

Mobile protocols, token storage, and AEAD test vectors use this construction.

Edge cases

  • Nonce reuse breaks confidentiality guarantees.
  • Changing additional data causes tag failure.
  • A modified tag must reject the message.

References