Course contentsShow
← Security
Lesson 127 of 3,0523. Symmetric Cryptography Deep DiveFree lesson

ChaCha20-Poly1305

Modern stream cipher with Poly1305 MAC, designed for software performance and constant-time implementation.

ChaCha20-Poly1305

What You'll Learn

You'll discover how ChaCha20-Poly1305 combines a modern stream cipher with authentication to create a fast, secure alternative to AES-GCM.

The Combined Solution

ChaCha20-Poly1305 is an authenticated encryption construction that pairs the ChaCha20 stream cipher (which you've already learned) with the Poly1305 message authentication code (MAC). Think of it as a duo: ChaCha20 encrypts your data, while Poly1305 ensures no one has tampered with it.

This combination follows the encrypt-then-MAC pattern you learned earlier—the safest way to build authenticated encryption. First, ChaCha20 encrypts the plaintext. Then, Poly1305 generates an authentication tag over the ciphertext, ensuring integrity and authenticity.

Why ChaCha20-Poly1305 Exists

While AES-GCM is the dominant standard, ChaCha20-Poly1305 solves specific problems:

  • Software performance: On devices without AES hardware acceleration (like smartphones or IoT devices), ChaCha20-Poly1305 is significantly faster than AES-GCM
  • Constant-time implementation: ChaCha20-Poly1305 is easier to implement without timing vulnerabilities, reducing side-channel attack risks
  • Simpler design: No complex Galois field mathematics like GCM; just addition, rotation, and XOR operations

Real-World Adoption

ChaCha20-Poly1305 is widely deployed in modern protocols like TLS 1.3, WireGuard VPN, and Google's QUIC protocol. It's particularly favored for mobile connections where software efficiency matters most.

Like AES-GCM, proper nonce management is critical—never reuse a nonce with the same key, or you compromise both confidentiality and authenticity.

Key Takeaway:
ChaCha20-Poly1305 is a modern authenticated encryption scheme combining ChaCha20's fast stream encryption with Poly1305's authentication, optimized for software performance and constant-time security on devices without hardware crypto acceleration.