0Pricing
Cryptology Academy · Lesson

SIV Mode: Nonce-Misuse Resistant AEAD

Explore Synthetic IV (SIV) mode and how it protects against catastrophic nonce reuse.

SIV Mode: Nonce-Misuse Resistant AEAD is a free Cryptology Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cryptology Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Nonce Reuse: A Catastrophic Failure

CTR-mode based AEAD ciphers like AES-GCM require a unique nonce for every encryption. If the same nonce is reused with the same key, an attacker who observes two ciphertexts can XOR them together to recover the XOR of the two plaintexts, immediately breaking confidentiality.

GCM Nonce Reuse Leaks the Auth Key

Nonce reuse in AES-GCM is even more catastrophic than in plain CTR mode. When two messages are encrypted under the same nonce and key, an attacker can recover the GHASH authentication key H entirely. With H known, the attacker can forge arbitrary authenticated messages.

Synthetic IV Mode Introduced

Synthetic IV (SIV) mode, defined in RFC 5297, was designed to eliminate nonce reuse vulnerabilities. Instead of requiring a random or counter-based nonce, SIV derives the IV synthetically from the plaintext itself using a pseudorandom function, making it deterministic and nonce-misuse resistant.

SIV Nonce Derivation Mechanism

In SIV, the nonce (called the synthetic IV) is computed as SIV = PRF(key, plaintext, associated_data). This IV is then used as the counter for CTR-mode encryption. Because the IV is derived from the plaintext, encrypting the same plaintext always produces the same ciphertext.

Nonce Reuse Consequence in SIV

If a nonce is reused in SIV because the same plaintext is encrypted twice, an observer learns only that two identical messages were sent. The plaintext content itself remains hidden. This is a dramatic improvement over CTR-based AEAD where nonce reuse reveals plaintext XOR.

AES-SIV Construction

AES-SIV (RFC 5297) uses the S2V function (a chained PRF based on AES-CMAC) to generate the synthetic IV, followed by AES-CTR encryption keyed with a second subkey. It requires two AES keys, making key management slightly more complex than single-key AEAD modes.

AES-GCM-SIV: Modern Alternative

AES-GCM-SIV (RFC 8452) is a more efficient nonce-misuse resistant AEAD designed to combine GCM performance with SIV-like safety. It derives per-message subkeys from the nonce and uses a Polyval authenticator, achieving better performance than AES-SIV while maintaining nonce-misuse resistance.

Performance Cost of Two Passes

SIV requires two passes over the data: one to compute the synthetic IV and one for encryption. This approximately doubles the computational cost compared to single-pass AEAD modes like AES-GCM. For latency-sensitive or high-throughput applications, this overhead must be considered.

When to Prefer SIV Over GCM

SIV is preferred when nonce generation is unreliable, when the application is stateless and cannot maintain a nonce counter, or when deterministic encryption is a requirement. Examples include encryption of database fields where the same value should always produce the same ciphertext for indexing purposes.

Stateless Services and Deterministic Encryption

Stateless microservices that cannot coordinate nonce state across replicas are prime candidates for SIV mode. Rather than risking accidental nonce reuse through a global counter, SIV provides safety automatically. Key wrapping (RFC 3394) also uses SIV principles for deterministic key encryption.

SIV in Practice

AES-SIV is available in major cryptographic libraries including libsodium (as crypto_aead_aes256gcm_siv in recent versions) and Google Tink. AES-GCM-SIV is supported in BoringSSL and Go standard library. When nonce management is difficult, these are safer defaults than standard AES-GCM.

SIV Nonce Misuse Check

What happens when the same key is used to encrypt the same plaintext twice with AES-SIV?

Lesson Recap: SIV for Nonce Safety

SIV mode eliminates nonce reuse catastrophes by deriving the IV from the plaintext itself. Nonce reuse reveals only that identical messages were sent, not their content. AES-GCM-SIV (RFC 8452) provides efficient nonce-misuse resistance for modern applications where stateless or deterministic encryption is needed.

Frequently asked questions

Is the “SIV Mode: Nonce-Misuse Resistant AEAD” lesson free?

Yes — the full text of “SIV Mode: Nonce-Misuse Resistant AEAD” is free to read here on the web, and the Cryptology Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cryptology Academy course, upgrade to CoddyKit PRO.

What will I learn in “SIV Mode: Nonce-Misuse Resistant AEAD”?

Explore Synthetic IV (SIV) mode and how it protects against catastrophic nonce reuse. You practise Cryptology Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cryptology Academy?

No prior experience is required. Cryptology Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “SIV Mode: Nonce-Misuse Resistant AEAD” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cryptology Academy lesson?

Yes. Every Cryptology Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Why Encrypt-Then-MAC Beats MAC-Then-Encrypt
  2. SIV Mode: Nonce-Misuse Resistant AEAD
  3. AEGIS: High-Speed Authenticated Encryption
  4. Selecting AEAD for Production Systems
← Back to Cryptology Academy