Word-level Even–Mansour block cipher and ideal-permutation PRP security #
The Even–Mansour block cipher ([EM97]; [BS23], Section 4.7;
[KL20]) constructs a block cipher on n-bit blocks from a public permutation P by
XORing pre-whitening and post-whitening keys before and after P:
$$E_{k_1, k_2}(x) = P(x \oplus k_1) \oplus k_2, \qquad D_{k_1, k_2}(y) = P^{-1}(y \oplus k_2) \oplus k_1,$$
together with the single-key variant $E_k(x) = P(x \oplus k) \oplus k$
([DKS12]).
This module provides the computational word-level counterpart to
CslibFrontier.Crypto.Protocols.Cipher.EvenMansour, mirroring how
CslibFrontier.Crypto.Computational.LubyRackoff pairs with
CslibFrontier.Crypto.Protocols.Cipher.LubyRackoff:
- Word-level Even–Mansour operations and
ComputableInPolyTimecertificates:evenMansourPreKeyWord,evenMansourPostKeyWord,splitTwoKeys,evenMansourEncryptWord,evenMansourDecryptWord,singleKeyEvenMansourEncryptWord, andsingleKeyEvenMansourDecryptWordact onList Boolwords, satisfy exact length, involution, inversion, andBitString nrepresentation laws, and carryComputableInPolyTimecertificates. Given polynomial-time word-level forward and inverse permutationsP, P_inv : ℕ → List Bool → List Bool,evenMansourCipherandsingleKeyEvenMansourCipherbundle the two-key (2 * n-bit key,n-bit block) and single-key (n-bit key,n-bit block) constructions as uniformBlockCipherinstances whose induced permutationsBlockCipher.permEquivagree withEvenMansour.evenMansourEquivandEvenMansour.singleKeyEvenMansourEquiv. - Asymptotic
Negligiblesecurity for polynomially query-bounded randomized (ProbOracleComp) distinguishers: building on the finite-group coin-fixing boundsEvenMansour.advantage_evenMansourProbRealGame_bitString_leandEvenMansour.advantage_singleKeyEvenMansourProbRealGame_bitString_lefromCslibFrontier.Crypto.Protocols.Cipher.EvenMansour, any family of randomized distinguishers whose cipher and primitive query budgetsQ_C, Q_P : ℕ → ℕare polynomially bounded hasNegligibledistinguishing advantage (negligible_advantage_evenMansourProbRealGame,negligible_advantage_singleKeyEvenMansourProbRealGame). - Word-oracle (
WordOracleComp) ideal-permutation games andIsOraclePPTsecurity:evenMansourWordRealGame,singleKeyEvenMansourWordRealGame, andevenMansourWordIdealGameexpose the bidirectional cipher and primitive permutation channels as word oracles (rejecting malformed queries with[]), satisfy the2 * Q_C * Q_P / 2 ^ nsecurity bound, and areGame.Indistinguishableagainst allIsOraclePPT encBooldistinguishers (indistinguishable_evenMansourWordRealGame_evenMansourWordIdealGame,indistinguishable_singleKeyEvenMansourWordRealGame_evenMansourWordIdealGame).
All security results here are information-theoretic in the ideal-permutation model: P is a
uniformly random permutation, the bounds hold for every distinguisher with the stated query counts
whatever its running time, and the IsOraclePPT theorems use that class only for its polynomial
query bound. No computational assumption is involved.
Main definitions #
Cslib.Crypto.evenMansourPreKeyWord,Cslib.Crypto.evenMansourPostKeyWord,Cslib.Crypto.splitTwoKeys: word-level XOR key masking and2 * n-bit key splitting.Cslib.Crypto.evenMansourEncryptWord,Cslib.Crypto.evenMansourDecryptWord,Cslib.Crypto.singleKeyEvenMansourEncryptWord,Cslib.Crypto.singleKeyEvenMansourDecryptWord: word-level Even–Mansour encryption and decryption.Cslib.Crypto.evenMansourCipher,Cslib.Crypto.singleKeyEvenMansourCipher: uniformBlockCipherbundles for two-key and single-key Even–Mansour.Cslib.Crypto.EvenMansourDistinguisher,Cslib.Crypto.evenMansourWordRealGame,Cslib.Crypto.singleKeyEvenMansourWordRealGame,Cslib.Crypto.evenMansourWordIdealGame: word-oracle ideal-permutation games.
Main results #
Cslib.Crypto.computableInPolyTime_evenMansourPreKeyWord,Cslib.Crypto.computableInPolyTime_evenMansourPostKeyWord,Cslib.Crypto.computableInPolyTime_splitTwoKeys,Cslib.Crypto.computableInPolyTime_evenMansourEncryptWord,Cslib.Crypto.computableInPolyTime_evenMansourDecryptWord: polynomial-time certificates for word-level Even–Mansour operations.Cslib.Crypto.evenMansourDecryptWord_evenMansourEncryptWord,Cslib.Crypto.evenMansourEncryptWord_evenMansourDecryptWord: word-level inversion laws.Cslib.Crypto.negligible_advantage_evenMansourProbRealGame,Cslib.Crypto.negligible_advantage_singleKeyEvenMansourProbRealGame: asymptoticNegligiblesecurity whenQ_CandQ_Pare polynomially bounded.Cslib.Crypto.advantage_evenMansourWordRealGame_evenMansourWordIdealGame_le,Cslib.Crypto.advantage_singleKeyEvenMansourWordRealGame_evenMansourWordIdealGame_le,Cslib.Crypto.indistinguishable_evenMansourWordRealGame_evenMansourWordIdealGame,Cslib.Crypto.indistinguishable_singleKeyEvenMansourWordRealGame_evenMansourWordIdealGame: quantitative and asymptotic security for word-oracle distinguishers, information-theoretic in the ideal-permutation model (IsOraclePPTsupplies only the query bound).
References #
- S. Even, Y. Mansour, A Construction of a Cipher from a Single Pseudorandom Permutation.
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 4.7 (Theorem 4.14, p. 159).
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, 3rd ed..
- O. Dunkelman, N. Keller, A. Shamir, Minimalism in Cryptography: The Even–Mansour Scheme Revisited.
Word-level Even–Mansour operations and ComputableInPolyTime certificates #
Pre-whitening XOR mask on bit words: x ⊕ k₁ (List.zipWith Bool.xor x k₁).
Post-whitening XOR mask on bit words: y ⊕ k₂ (List.zipWith Bool.xor y k₂).
Length, involution, and representation lemmas #
Applying evenMansourPreKeyWord k₁ twice cancels on equal-length words.
Applying evenMansourPostKeyWord k₂ twice cancels on equal-length words.
On BitString n, evenMansourPreKeyWord computes x + k₁.
On BitString n, evenMansourPostKeyWord computes y + k₂.
The first subkey returned by splitTwoKeys n key has length n when key.length = 2 * n.
The second subkey returned by splitTwoKeys n key has length n when key.length = 2 * n.
Word-level Even–Mansour encryption preserves n-bit block length when P preserves n-bit
words and the subkeys have length n.
Word-level Even–Mansour decryption preserves n-bit block length when P_inv preserves
n-bit words and the subkeys have length n.
Word-level Even–Mansour decryption inverts encryption on n-bit words whenever P_inv
left-inverts P on n-bit words and P preserves n-bit length.
Word-level Even–Mansour encryption inverts decryption on n-bit words whenever P_inv
right-inverts P on n-bit words and P_inv preserves n-bit length.
Single-key word-level decryption inverts encryption on n-bit words.
Single-key word-level encryption inverts decryption on n-bit words.
When P represents π : Equiv.Perm (BitString n) on n-bit words, evenMansourEncryptWord
computes EvenMansour.evenMansourEquiv π k₁ k₂.
When P_inv represents π.symm on n-bit words, evenMansourDecryptWord computes
(EvenMansour.evenMansourEquiv π k₁ k₂).symm.
ComputableInPolyTime certificates #
Pre-whitening XOR masking is computable in polynomial time.
Post-whitening XOR masking is computable in polynomial time.
Splitting a 2 * n-bit key into two n-bit keys is computable in polynomial time.
Word-level Even–Mansour encryption is computable in polynomial time whenever P is.
Word-level Even–Mansour decryption is computable in polynomial time whenever P_inv is.
Parameterized two-key Even–Mansour encryption is computable in polynomial time whenever P
is.
Parameterized two-key Even–Mansour decryption is computable in polynomial time whenever P_inv
is.
Parameterized single-key Even–Mansour encryption is computable in polynomial time whenever P
is.
Parameterized single-key Even–Mansour decryption is computable in polynomial time whenever
P_inv is.
Uniform BlockCipher bundles #
The permutation on BitString n induced by a pair of length-preserving inverse word functions
(P n, P_inv n).
The uniform two-key Even–Mansour BlockCipher with 2 * n-bit keys and n-bit blocks, built
from polynomial-time inverse word permutations P and P_inv
([EM97]; [BS23], Section 4.7).
The uniform single-key Even–Mansour BlockCipher with n-bit keys and n-bit blocks, built
from polynomial-time inverse word permutations P and P_inv ([DKS12]).
The permutation induced by evenMansourCipher on a 2 * n-bit key key equals
EvenMansour.evenMansourEquiv with the split n-bit subkeys.
The permutation induced by singleKeyEvenMansourCipher on an n-bit key key equals
EvenMansour.singleKeyEvenMansourEquiv.
Asymptotic Negligible security for polynomially query-bounded ProbOracleComp #
distinguishers
Asymptotic two-key Even–Mansour security for polynomially query-bounded randomized
distinguishers ([EM97]; [BS23], Theorem 4.14): for any family of randomized
distinguishers program : (n : ℕ) → ProbOracleComp (EvenMansourSpec (BitString n)) Bool whose
cipher and primitive query budgets Q_e, Q_π : ℕ → ℕ are polynomially bounded, the distinguishing
advantage is Negligible.
Asymptotic single-key Even–Mansour security for polynomially query-bounded randomized
distinguishers ([DKS12]; [BS23], Section 4.7): for any family of
randomized distinguishers program : (n : ℕ) → ProbOracleComp (EvenMansourSpec (BitString n)) Bool
whose cipher and primitive query budgets Q_e, Q_π : ℕ → ℕ are polynomially bounded, the
distinguishing advantage is Negligible.
Word-oracle (WordOracleComp) ideal-permutation games and IsOraclePPT security #
A parameterized adaptive word-oracle distinguisher in the Even–Mansour ideal-permutation model:
operation (false, false) queries cipher encryption, (false, true) queries cipher decryption,
(true, false) queries the forward public permutation, and (true, true) queries the inverse
public permutation.
Separate cipher and primitive query budgets for a WordOracleComp (Bool × Bool) distinguisher.
Any word-oracle distinguisher making at most Q total queries satisfies
IsWordCallBounded program Q Q.
The real word-oracle two-key Even–Mansour experiment: sample a uniform permutation π of
BitString n and a uniform 2 * n-bit key key, and run adversary n [] against the two-key
Even–Mansour cipher and primitive permutation word channels (answering malformed queries of length
≠ n with []).
The real word-oracle single-key Even–Mansour experiment: sample a uniform permutation π of
BitString n and a uniform n-bit key key, and run adversary n [] against the single-key
Even–Mansour cipher and primitive permutation word channels (answering malformed queries of length
≠ n with []).
The ideal word-oracle Even–Mansour experiment: sample two independent uniform permutations
E, π of BitString n and run adversary n [] against the bidirectional word channels of E and
π (answering malformed queries of length ≠ n with []).
Word-oracle two-key Even–Mansour security bound ([EM97];
[BS23], Theorem 4.14): any word-oracle distinguisher making at most Q_e cipher queries
and at most Q_π primitive permutation queries at security parameter n has distinguishing
advantage at most 2 * Q_e * Q_π / 2 ^ n.
Word-oracle single-key Even–Mansour security bound ([DKS12];
[BS23], Section 4.7): any word-oracle distinguisher making at most Q_e cipher queries
and at most Q_π primitive permutation queries at security parameter n has distinguishing
advantage at most 2 * Q_e * Q_π / 2 ^ n.
Asymptotic word-oracle two-key Even–Mansour security for any distinguisher with
polynomially bounded cipher and primitive query schedules Q_e, Q_π : ℕ → ℕ.
Asymptotic word-oracle single-key Even–Mansour security for any distinguisher with
polynomially bounded cipher and primitive query schedules Q_e, Q_π : ℕ → ℕ.
Two-key Even–Mansour security in the ideal-permutation model, against IsOraclePPT
distinguishers ([EM97]; [BS23], Theorem 4.14; [KL20]): no
uniform IsOraclePPT encBool distinguisher can distinguish evenMansourWordRealGame from
evenMansourWordIdealGame with non-negligible advantage. The security is information-theoretic:
the permutation is ideal, and the proof uses IsOraclePPT only for its polynomial query bound, so
the conclusion holds for every distinguisher with polynomially many queries
(negligible_advantage_evenMansourWordRealGame).
Single-key Even–Mansour security in the ideal-permutation model, against IsOraclePPT
distinguishers ([DKS12]; [BS23], Section 4.7): no uniform
IsOraclePPT encBool distinguisher can distinguish singleKeyEvenMansourWordRealGame from
evenMansourWordIdealGame with non-negligible advantage. The security is information-theoretic:
the permutation is ideal, and the proof uses IsOraclePPT only for its polynomial query bound, so
the conclusion holds for every distinguisher with polynomially many queries
(negligible_advantage_singleKeyEvenMansourWordRealGame).