A stream cipher with a linear checksum has no ciphertext integrity #
Boneh and Shoup's Attack 3 on WEP in Section 9.10 ([BS23], printed pp. 390–391)
encrypts a message together with its CRC checksum by a stream cipher,
c = (m, CRC(m)) ⊕ RC4(IV ‖ k), and uses that "there is a public function L such that for any
m and Δ … CRC(m ⊕ Δ) = CRC(m) ⊕ L(Δ)". An attacker who XORs (Δ, L(Δ)) into c gets a
ciphertext that "decrypts without errors to m ⊕ Δ", so "given the encryption of m, an
attacker can create a valid encryption of m ⊕ Δ for any Δ of his choice."
prfChecksumCipher encrypts msg ++ checksum msg under the one-block PRF cipher prfCipher at
parameter n + csLen n, and decryption rejects unless the checksum matches. When checksum is
linear with a public L, XORing delta ++ L delta into the ciphertext after its initial value
gives an encryption of msg ⊕ delta, for every delta of length n
(ivStreamXorBody_mem_support_encrypt_prfChecksumCipher). The adversary prfChecksumCIAdversary
asks for an encryption of 0ⁿ and outputs it modified by 1ⁿ ++ L 1ⁿ, which decrypts to 1ⁿ;
it wins the one-time ciphertext-integrity game with probability 1 for every 1 ≤ n
(eval_ciOneTimeGame_prfChecksumCipher).
Differences from the book: prfCipher stands for RC4 and any checksum with the stated linearity
for CRC-32; WEP itself is not modelled, and nothing is proved about the chosen-plaintext security
of prfChecksumCipher. The book says that WEP, in a sense, uses MAC-then-encrypt with a CRC
instead of a MAC; prfChecksumCipher is not an instance of macThenEncrypt, which frames its
plaintext with encPair. The attack needs 1 ≤ n: at n = 0 the adversary's output can be the
ciphertext it was given.
Main definitions #
Cslib.Crypto.prfChecksumCipher: the PRF stream cipher over message ‖ checksum.Cslib.Crypto.prfChecksumCIAdversary: the one-query ciphertext-integrity adversary.
Main results #
Cslib.Crypto.ivStreamXorBody_mem_support_encrypt_prfChecksumCipher: from an encryption ofmsg, a valid encryption ofmsg ⊕ deltafor anydelta.Cslib.Crypto.isOraclePPT_prfChecksumCIAdversary: the adversary is efficient.Cslib.Crypto.eval_ciOneTimeGame_prfChecksumCipher: it wins with probability1.Cslib.Crypto.not_oneTimeCiphertextIntegrity_prfChecksumCipher,Cslib.Crypto.not_ciphertextIntegrity_prfChecksumCipher: no ciphertext integrity.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 9.10, Attack 3 (printed pp. 390–391).
The PRF stream cipher over message ‖ checksum, modelling WEP's
c = (m, CRC(m)) ⊕ RC4(IV ‖ k) ([BS23], Section 9.10, Attack 3): encrypt
msg ++ checksum msg with prfCipher at parameter n + csLen n, where csLen gives the
checksum length, and on decryption return the first n bits only if the rest is their
checksum. Its ciphertext space is prfCipher's at parameter n + csLen n.
Malleability of a stream cipher with a linear checksum ([BS23], Section 9.10,
Attack 3): if checksum (m ⊕ d) = checksum m ⊕ L d whenever m and d have the same length,
then XORing delta ++ L delta into an encryption of an n-bit msg after its initial value
gives an encryption of msg ⊕ delta, for every n-bit delta.
One-query ciphertext-integrity adversary against prfChecksumCipher ([BS23],
Section 9.10, Attack 3): ask for an encryption of 0ⁿ and output it with 1ⁿ ++ L 1ⁿ XORed in
after its initial value.
prfChecksumCIAdversary is an efficient oracle adversary when the checksum length and L
are computable in polynomial time.
prfChecksumCIAdversary wins the one-time ciphertext-integrity game against
prfChecksumCipher with probability 1 for every linear checksum and every 1 ≤ n
([BS23], Section 9.10, Attack 3).
The PRF stream cipher over message ‖ linear checksum is not one-time ciphertext-integral ([BS23], Section 9.10, Attack 3).
The PRF stream cipher over message ‖ linear checksum has no ciphertext integrity ([BS23], Section 9.10, Attack 3).