Output feedback mode from a uniform pseudorandom function #
Output feedback (OFB) mode ([BS23], Exercise 5.15(b), printed p. 212) encrypts a message
of v blocks m[1], …, m[v] under a key k by drawing a uniform initial value x₀ and sending
(x₀, c[1], …, c[v]) with xᵢ = F(k, xᵢ₋₁) and c[i] = m[i] ⊕ xᵢ. Here the security parameter
n is the block length: the PRF family takes n-bit keys and n-bit inputs to n-bit
outputs. A message is any word made of whole blocks. ofbWordEncrypt outputs the word
x₀ ++ c, and ofbWordDecrypt inverts it; both are the shared envelope ivStreamEncrypt,
ivStreamDecrypt with the chain keystream ofbWordKeystream. Each chain value is truncated to
n bits (ofbWordStep). For keys of length n this changes nothing; for other keys it keeps
the chain, and so encryption, polynomial-time.
Security is many-query left-or-right CPA security (SymmetricINDCPAOn, Attack Game 5.2) on
equal-length pairs of whole blocks (blockPairValid), in the standard model, against uniform
strict oracle-PPT adversaries. The PRF distinguisher ofbToPrfDistinguisher adversary bit is the
shared stream reduction ivStreamToPrfDistinguisher with the chain keystream queries
ofbKeystreamQueries: it runs the adversary and answers each admissible request itself, drawing
the initial value and obtaining each chain value with one query to its own function oracle on the
previous one, keeping at most n bits of the reply.
- It is uniform strict oracle PPT whenever the adversary is
(
isOraclePPT_ofbToPrfDistinguisher). - Against the keyed oracle, its output law is that of the adversary in the CPA game with
challenge bit
bit(eval_prfRealGame_ofbToPrfDistinguisher). - Against a uniform random function, it is the typed reduction
ofbReductionofOFBMode.leanrun on the adversary read as a block-mode adversary (blockModeWordAdversary), and the typed chain-collision boundadvantage_idealExperiment_ofbReduction_leapplies. This gives the concrete boundadvantage_ofbWordCPAGame_leand thenPseudorandomFunction.indcpa_ofbWordEncrypt.
Deviations from Exercise 5.15(b) #
- Any number of blocks. The exercise fixes a poly-bounded
ℓand the message spaceX^ℓ. Here every whole-block length is admitted, which implies the statement for everyℓ. - Two fixed-bit distinguishers. As for
prfCipher, the bound uses the PRF advantages ofofbToPrfDistinguisher adversary falseandofbToPrfDistinguisher adversary true. Its collision term is2 (Q L) (Q L + L) / 2 ^ nforQrequests of at mostLbits, from the typed boundK (K + ℓ) / 2 ^ nwithK = Q Lblocks in total and at mostℓ = Lper request.
Main definitions #
Cslib.Crypto.ofbWordStep,Cslib.Crypto.ofbWordKeystream: chain steps and keystream.Cslib.Crypto.ofbWordEncrypt,Cslib.Crypto.ofbWordDecrypt: the cipher on whole-block words.Cslib.Crypto.ofbKeystreamStep,Cslib.Crypto.ofbKeystreamQueries: the keystream from the function oracle.Cslib.Crypto.ofbToPrfDistinguisher: the reduction to the PRF game.
Main results #
Cslib.Crypto.ofbWordDecrypt_ofbWordEncrypt: decryption inverts encryption.Cslib.Crypto.isPPTOn_ofbWordEncrypt,Cslib.Crypto.computableInPolyTime_ofbWordDecrypt: efficiency of the honest algorithms.Cslib.Crypto.isOraclePPT_ofbToPrfDistinguisher: the reduction is uniform strict oracle PPT.Cslib.Crypto.eval_prfRealGame_ofbToPrfDistinguisher: the real PRF game of the reduction is the CPA game.Cslib.Crypto.advantage_ofbWordCPAGame_le: the concrete CPA bound.Cslib.Crypto.PseudorandomFunction.indcpa_ofbWordEncrypt: OFB mode is CPA-secure for everyPseudorandomFunction.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 5.3 (Attack Game 5.2, printed pp. 181–182) and Exercise 5.15 (printed p. 212).
The cipher #
Under a key of length n, a family with n-bit outputs on n-bit inputs produces a
keystream of blocks * n bits from an n-bit initial value.
Decryption inverts encryption on whole-block messages under keys of length n.
Efficiency of the honest algorithms #
The keystream is computable in polynomial time from the family's evaluator: every chain value
has at most n bits, so each step grows the encoded state by at most 3 n bits.
OFB encryption is uniformly strict PPT in (n, k, msg).
OFB decryption is computable in polynomial time on (n, k, ct).
The reduction to the PRF game #
The keystream of blocks blocks from the function oracle, with one query per block.
The PRF distinguisher built from a left-or-right CPA adversary against OFB mode: the shared
stream reduction ivStreamToPrfDistinguisher with the chain keystream queries
ofbKeystreamQueries.
Answered by the keyed oracle under a key of length n, the keystream queries from an n-bit
initial value compute the keystream.
Real game. Against the keyed oracle, ofbToPrfDistinguisher adversary bit has the output
law of adversary in the OFB CPA game with challenge bit bit.
Efficiency of the reduction. For every uniform strict oracle-PPT adversary,
ofbToPrfDistinguisher adversary bit is uniform strict oracle PPT.
The ideal game #
Concrete CPA bound for OFB mode, after [BS23], Exercise 5.15(b), which asks for
CPA security and states no concrete bound. At parameter n, an adversary making at most Q
requests of at most L bits has CPA advantage against ofbWordEncrypt family at most the PRF
advantages of ofbToPrfDistinguisher adversary false and ofbToPrfDistinguisher adversary true
plus 2 (Q L) (Q L + L) / 2 ^ n, from the typed chain-collision bound.
OFB mode is CPA-secure for a pseudorandom function ([BS23], Exercise 5.15(b)):
if family is a PseudorandomFunction, OFB mode with n-bit blocks at security parameter n
has negligible many-query left-or-right CPA advantage on equal-length pairs of whole blocks,
against every uniform strict oracle-PPT adversary. The exercise fixes the number of blocks ℓ;
here every number of blocks is admitted.