ChaCha20 / Poly1305 / AEAD (RFC 8439)

Run the ChaCha20 stream cipher, the Poly1305 MAC or the combined ChaCha20-Poly1305 AEAD on hex keys and nonces. The defaults reproduce the RFC 8439 test vector, so you can check your own output.

Use the tool

Why this tool exists

ChaCha20-Poly1305 is used in TLS 1.3, WireGuard and many messaging protocols, yet it is awkward to check by hand. When you write your own implementation, or debug one that fails against another library, you need a reference to compare against. The usual approach is a throwaway script, which is slow and easy to get wrong.

This tool is that reference. It is pre-filled with the example from RFC 8439 section 2.8.2, so you can see the expected ciphertext and tag straight away, then swap in your own key, nonce and associated data. Everything is calculated in your browser and nothing you type is uploaded. It is meant for testing and learning, not for protecting real data.

How to use it

  1. Choose a mode: aead-encrypt, aead-decrypt, raw chacha20 or poly1305.
  2. Enter the 32-byte key and 12-byte nonce as hex, and the optional AAD as hex.
  3. Type or paste the plaintext, or the hex ciphertext followed by the tag when decrypting.
  4. Read the ciphertext, tag and combined output, or the plaintext and tag status.

Frequently asked questions

Does it match the RFC 8439 test vector?

Yes. The default key, nonce, AAD and plaintext are the example from RFC 8439 section 2.8.2. If you leave them unchanged, the ciphertext and tag should match the values printed in the RFC.

What happens if the tag is wrong when decrypting?

Decryption stops with an authentication error and no plaintext is shown. The tag comparison is done without early exit. A wrong key, nonce, AAD or any changed byte in the ciphertext all give the same error.

Can I use this to protect real secrets?

No. The cipher code is hand-written for checking and teaching, and the page cannot manage keys or nonces safely for you. Never reuse a nonce with the same key. Use an audited library for real data.

What input format does decryption expect?

Hex text: the ciphertext followed directly by the 16-byte tag. The key must be 32 bytes and the nonce 12 bytes for AEAD modes, otherwise the tool reports an error.