Pcornel
Security · Symmetric Cryptography

ChaCha20

Cheat sheet · https://pcornel.dk/topic.php?topic=4690

Back to the Topic

Answer

ChaCha20 is a fast stream cipher, usually paired with Poly1305 for authentication (ChaCha20-Poly1305). It is used in TLS 1.3, WireGuard and SSH, especially on devices without AES hardware.

Remember

  • ChaCha20-Poly1305 is fast without AES hardware.
  • It is used in TLS 1.3, WireGuard and SSH.
  • Never reuse a nonce with the same key.

First checks

  • openssl speed -evp chacha20-poly1305 — performance
  • openssl s_client -connect <host>:443 -ciphersuites TLS_CHACHA20_POLY1305_SHA256 </dev/null — TLS 1.3 test
  • wg show — WireGuard uses ChaCha20-Poly1305

Verify in this order

key + nonce → ChaCha20 stream + Poly1305 tag

Where it usually breaks

First mismatch in key/secret generation → storage/rotation → trust/certificate validation → protocol negotiation → cryptographic operation → peer/application verification; preserve identity/policy/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4690

Confirmation

Confirm action

Continue?