Finite pseudorandom permutations #
A block cipher with keys in Key and blocks in D is a keyed permutation E : Key → Equiv.Perm D.
In the chosen-plaintext game ([BS23], Section 4.1.2, Attack Game 4.1) an adaptive oracle
adversary with private coins queries either E key for one uniform key or one uniform
permutation π of D. In the chosen-ciphertext game (strong PRP, Section 4.1.3) it may also
query the inverse, through the bidirectional interface RandomPermutation.PermOracleSpec D.
The ideal-experiment switching lemma ([BS23], Attack Game 4.3 and Theorem 4.6) bounds
the advantage of a Q-query adversary between a uniform permutation and a uniform function of D
by Q.choose 2 / |D| (advantage_idealExperiment_prfIdealExperiment_le). Hence PRP and PRF
advantages differ by at most Q.choose 2 / |D| (abs_advantage_sub_prfAdvantage_le, Theorem 4.4),
and in particular PRP security implies PRF security up to that term
(prfAdvantage_le_advantage_add). A forward adversary runs unchanged against the bidirectional
interface (StrongAdversary.ofForward), so strong PRP security implies PRP security
(strongAdvantage_ofForward).
The word-level asymptotic notions Cslib.Crypto.BlockCipher.PRP and
Cslib.Crypto.BlockCipher.StrongPRP derive their switching lemma from this one.
Main definitions #
Cslib.Crypto.PRP.realExperiment,Cslib.Crypto.PRP.idealExperiment,Cslib.Crypto.PRP.advantage: the chosen-plaintext experiments and their advantage.Cslib.Crypto.PRP.StrongAdversary,Cslib.Crypto.PRP.strongRealExperiment,Cslib.Crypto.PRP.strongIdealExperiment,Cslib.Crypto.PRP.strongAdvantage: the chosen-ciphertext experiments and their advantage.Cslib.Crypto.PRP.StrongAdversary.ofForward: run a forward adversary against the bidirectional interface.
Main results #
Cslib.Crypto.PRP.advantage_idealExperiment_prfIdealExperiment_le: the ideal-experiment PRP/PRF switching lemma.Cslib.Crypto.PRP.abs_advantage_sub_prfAdvantage_le: the two-sided PRF switching lemma.Cslib.Crypto.PRP.prfAdvantage_le_advantage_add: a PRP is a PRF up toQ.choose 2 / |D|.Cslib.Crypto.PRP.strongAdvantage_ofForward: strong PRP security implies PRP security.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Section 4.1.2, Attack Game 4.1, Section 4.1.3, and Section 4.4.3, Attack Game 4.3, Theorem 4.4 and Theorem 4.6.
Chosen-plaintext security #
The real chosen-plaintext experiment: sample one uniform key and answer every query x with
E key x. It is the real PRF experiment for the keyed function E.
The ideal chosen-plaintext experiment: sample one uniform permutation π of D and answer
every query x with π x.
The PRP distinguishing advantage of A against E.
The law of idealExperiment: a uniform permutation π, then the adversary interpreted at the
PMF level against π.
Ideal-experiment PRP/PRF switching lemma ([BS23], Attack Game 4.3 and
Theorem 4.6): an adversary making at most Q queries distinguishes a uniform permutation of D
from a uniform function D → D with advantage at most Q.choose 2 / |D|.
PRF switching lemma ([BS23], Theorem 4.4): for any keyed permutation E and any
adversary A making at most Q queries, the block-cipher (PRP) and PRF distinguishing advantages
differ by at most Q.choose 2 / |D|.
A PRP is a PRF ([BS23], half of Theorem 4.4): against an adversary making at
most Q queries, the PRF advantage of a block cipher is at most its PRP advantage plus
Q.choose 2 / |D|.
Strong pseudorandom permutations #
An adaptive test with private coins and oracle access to a permutation of D and its inverse:
.forward x asks for π x and .inverse y asks for π.symm y.
Run a forward adversary against the bidirectional interface, sending every query to the forward direction. Private samples are unchanged.
Running ofForward A against any bidirectional oracle runs A against its forward direction.
ofForward A makes as many queries as A.
The real chosen-ciphertext experiment: sample one uniform key and answer .forward x with
E key x and .inverse y with (E key).symm y.
A forward adversary plays the real chosen-ciphertext experiment as the chosen-plaintext one.
The ideal chosen-ciphertext experiment: sample one uniform permutation π of D and answer
.forward x with π x and .inverse y with π.symm y.
The strong PRP distinguishing advantage of A against E.
A forward adversary plays the ideal chosen-ciphertext experiment as the chosen-plaintext one.
Strong PRP security implies PRP security ([BS23], Section 4.1.3): the forward
adversary ofForward A has the PRP advantage of A.