Definition
SIV (synthetic initialization vector) is a form of authenticated encryption §5.16, which hides a message and detects any change, whose initialization vector (the per-message starting value of encryption) is computed from the message. A keyed pseudorandom function §15.1 maps the associated data (authenticated but unencrypted inputs) and the plaintext to a 16-byte value that serves as both tag and starting counter. Misuse resistance follows: if a nonce §5.18 (a value meant for one use per key) repeats, authenticity survives and only exact repeats of a whole input show. RFC 5297 defines it.
The idea
Ordinary authenticated encryption takes a nonce, a value that must never repeat under one key, and usually encrypts with counter mode §15.5: it combines the message by bitwise XOR (exclusive or) with a keystream, a pseudorandom byte sequence fixed by the key and the nonce. Real systems do repeat nonces: a device loses its message counter in a power cut, or a virtual machine §2.3 restored from a snapshot reuses its last nonces. A repeated nonce repeats the keystream, the XOR of the two ciphertexts then equals the XOR of the two plaintexts, and knowing one plaintext reveals the other. In some modes the repetition also lets an attacker forge tags.
SIV lets each message choose its own starting value. It first computes the tag as a pseudorandom function (a keyed function whose outputs look random to anyone without the key) of everything being protected, the nonce included, and then uses the tag as the initial counter of counter mode. Inputs that differ anywhere get unrelated tags and so unrelated keystreams, whether or not the nonce repeated. Only an input identical in every part gives the same ciphertext, and that ciphertext tells an observer only that the input was repeated. The price is a second pass: the whole plaintext must be read before encryption can begin.
How it works
AES-SIV, as RFC 5297 defines it, has these inputs and this output:
a key of 256, 384 or 512 bits, split into halves: the left half computes the tag and the right half encrypts;
the plaintext , of any length;
a list of associated-data strings , at most 126 of them; a nonce, if one is used, is the last;
the output: the 16-byte synthetic initialization vector followed by the ciphertext , which is as long as . It is written , where joins two byte strings end to end.
Encryption:
Tag. Compute with the function that RFC 5297 calls S2V, keyed with . S2V applies CMAC §15.7 (cipher-based message authentication code), a message authentication code §5.7 built from AES, to a 16-byte block of zeros and to each separately. It folds these results together by XOR, doubling the running value before each fold. Doubling is a one-bit left shift followed, when the bit shifted out is 1, by an XOR with a fixed constant; it makes the order of the strings matter. Then S2V combines the running value with the plaintext and applies one final CMAC. A plaintext of 16 bytes or more has the running value combined by XOR into its last 16 bytes; a shorter plaintext is padded to 16 bytes and combined by XOR with the running value doubled once more.
Counter. Copy to and clear bit 63 and bit 31, counting the rightmost bit as bit 0, so that an implementation may increment the counter with ordinary 32-bit or 64-bit addition.
Encrypt. Encrypt , , and so on with AES under , and combine the resulting keystream with by XOR to get .
Output .
Decryption takes the first 16 bytes as , forms and the keystream as above, and recovers a candidate plaintext from . It recomputes S2V over the associated data the receiver holds and the candidate. If the result equals , checked with a constant-time comparison §4.33, it returns the plaintext; otherwise it returns and releases nothing of the candidate.
With a nonce among the associated data, AES-SIV is nonce-based authenticated encryption. Without one, it is deterministic authenticated encryption §19.1.10, which RFC 5297 offers for key wrapping §19.1.12. A later design, AES-GCM-SIV (GCM stands for Galois/Counter Mode), defined in RFC 8452 [436], applies the same idea with a fast polynomial hash in place of CMAC.
Worked example
This is the deterministic example of RFC 5297, Appendix A.1, in hexadecimal, with one associated-data string and no nonce:
=
fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0
=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
= the 24 bytes10,11, and so on up to27
=112233445566778899aabbccddee, 14 bytes
S2V under :
The CMAC of 16 zero bytes is
0e04dfafc1efbf040140582859bf073a.Its first byte
0eis below80, so its leftmost bit is 0 and doubling is a plain left shift:1c09bf5f83df7e080280b050b37e0e74.The CMAC of is
f1f922b7f5193ce64ff80cb47d93f23b. Combined by XOR with the doubled value, it givesedf09de876c642ee4d78bce4ceedfc4f.The plaintext is shorter than 16 bytes, so the running value is doubled again. Its first byte
edis above80, so its leftmost bit is 1, and after the shift the last byte is combined by XOR with the constant87:4fshifts to9e, and9eXOR87=19. The result isdbe13bd0ed8c85dc9af179c99ddbf819.Padding the plaintext with the byte
80and then zero bytes up to 16 bytes gives
112233445566778899aabbccddee8000.
Its XOR with the doubled value iscac30894b8eaf254035bc20540357819.The final CMAC of that block is =
85632d07c6e8f37f950acd320a2ecc93.
Counter. Number the bytes of from 0 at the left. Bit 63 is the leftmost bit of byte 8, and bit 31 is the leftmost bit of byte 12. Byte 8 is 95, binary 10010101; clearing its leftmost bit gives 00010101, which is 15. Byte 12 is 0a, binary 00001010, whose leftmost bit is already 0. So = 85632d07c6e8f37f150acd320a2ecc93.
Encryption. The 14-byte plaintext needs one 16-byte keystream block. AES under turns into 51e218d2c5a2ab8c4345c4a623b2f08f. Its first 14 bytes are combined by XOR with : the first byte gives 11 XOR 51 = 40, the second 22 XOR e2 = c0, and so on, so = 40c02b9690c4dc04daef7f6afe5c. The last 2 keystream bytes are discarded.
The output is bytes and equals the output printed in RFC 5297. Encrypting the same and again gives the same 30 bytes, and that equality is all an observer learns. A receiver whose differs in one bit recomputes a different S2V value, except with negligible probability, and gets .
Stated precisely
Let be AES encryption under , bitwise XOR, bitwise AND, the length of in bits, and the first bits of . Let be the 128-bit value whose bits are all 1 except bit 63 and bit 31, where bit 0 is the rightmost bit. RFC 5297 defines where is addition modulo and is the output. Decryption recomputes from and returns it only if ; otherwise it returns .
Three assumptions carry the guarantees.
A secret, uniformly random key , whose halves are used for nothing else.
AES is a pseudorandom permutation §15.2: under a secret random key, no feasible computation tells AES apart from a randomly chosen permutation of 128-bit blocks.
Bounded use: at most 126 associated-data strings per message, because the proof of S2V covers at most 127 strings and the plaintext is one of them, and a bounded number of messages per key, for which RFC 5297 recommends at most .
If all three hold, RFC 5297, citing the proof of Rogaway and Shrimpton presented at the Eurocrypt 2006 conference [435], states three guarantees.
Authenticity, whether or not nonces repeat: an attacker cannot construct an input that decryption accepts, other than an output that encryption produced for the same associated data.
Confidentiality §1.8 for distinct inputs: if no two encryptions under have identical associated data and plaintext, which unique nonces ensure, the outputs cannot be told apart from random bit strings of the same lengths.
Confidentiality for repeated nonces: the only extra information revealed is whether two encryptions had identical associated data, the nonce included, and identical plaintext.
Misuse resistance names this behavior under nonce repetition. No deterministic computation can reveal less, since identical inputs must give identical outputs.
Limits and common mistakes
Misuse resistance does not mean that nonce reuse leaks nothing: identical inputs still give identical outputs, an equality leakage that the entry on deterministic authenticated encryption works out.
Usage limits remain. By the birthday bound §5.6, two different inputs get the same or overlapping counter ranges with a probability that grows with the square of the number of messages, and an overlap reuses keystream across different plaintexts. RFC 5297 therefore recommends at most messages per key.
SIV is two-pass: no ciphertext comes out before the whole plaintext has been read, which costs memory or a second read on a device with little RAM.
SIV does not stop replay, since a recorded output decrypts correctly when sent again, and it does not decide authorization §1.7.
Use the specified construction exactly. A home-made variant, such as one key used in both roles or fields joined into one string without lengths, falls outside the proof. Side channels §1.29, leaked keys and faulty implementations are outside the guarantee as well.
Questions answered
Does misuse resistant mean nonce reuse leaks nothing?
No. Misuse resistance, the property of SIV (synthetic initialization vector) authenticated encryption such as AES-SIV, which is built on the Advanced Encryption Standard, means that a repeated nonce does far less damage than in ordinary modes, not that it does none. When a nonce repeats, authenticity is unaffected, but if the key, the nonce, the associated data and the plaintext are all identical, the ciphertext is identical too, so an observer learns that the same message was encrypted again. Inputs that differ anywhere still give unrelated ciphertexts, and no deterministic computation can hide more, since identical inputs must give identical outputs.
Ordinary designs built on counter mode fail far worse: a repeated nonce repeats the keystream and exposes the exclusive or of the two plaintexts. Per-key usage limits, replay protection and authorization remain the job of the rest of the system.
Related entries: Deterministic authenticated encryption and equality leakage (§19.1.10), Authenticated encryption (AEAD) (§5.16), Cipher-based MAC (CMAC) (§15.7), Counter mode (CTR) (§15.5). Further reading: [48, 153, 435, 436].