The Even–Mansour cipher in the ideal-permutation model #
The Even–Mansour construction ([BS23], Section 4.7; [EM97]) builds a block
cipher from a single public permutation π : Equiv.Perm G on a finite group G by XORing (or
adding in G) independent pre-whitening and post-whitening keys (k₀, k₁) ∈ G × G:
$$E((k_0, k_1), x) = \pi(x + k_0) + k_1, \qquad D((k_0, k_1), y) = \pi^{-1}(y - k_1) - k_0.$$
In the single-key variant ([DKS12]), k₀ = k₁ = k.
We formalize four aspects of the Even–Mansour construction:
- Algebraic structure and one-query secrecy:
evenMansourEquiv π k₀ k₁ : Equiv.Perm Gbundles encryption and decryption as a permutation ofG, satisfies the inverse-cipher conjugation law(evenMansourEquiv π k₀ k₁).symm = evenMansourEquiv π.symm (-k₁) (-k₀)(which swapsk₀andk₁over any group of exponent two such asBitString n), acts as a bijection onEquiv.Perm Gfor every fixed key pair (evenMansourPermEquiv), and achieves perfect one-query secrecy for any fixedπ(map_prod_evenMansourEncrypt_uniformOfFintype). - Necessity of both whitening keys ([BS23], Section 4.7): omitting post-whitening
(
preWhitenEquiv π k₀ x = π (x + k₀)) or pre-whitening (postWhitenEquiv π k₁ x = π x + k₁) allows an explicit 2-query adversary (making1cipher query and1primitive permutation query,IsCallBounded _ 1 1) to recover the secret key with probability1and achieve key-recovery game advantage1 - |G|⁻¹against an independent uniform permutation and uniform target key (advantage_preWhitenKeyRecoveryGame_eq,advantage_postWhitenKeyRecoveryGame_eq). - One-sided query security: because
evenMansourPermEquiv k₀ k₁is a bijection onEquiv.Perm G, any adversary that queries only the cipher oracle (liftLeft) or only the primitive permutation oracle (liftRight) has zero distinguishing advantage between the real Even–Mansour game and two independent uniform permutations (advantage_evenMansourRealGame_liftLeft_eq_zero,advantage_evenMansourRealGame_liftRight_eq_zero). - Bad-key transcript intersection bound ([BS23], Theorem 4.10): given a cipher
transcript
T_e : List (G × G)and a primitive permutation transcriptT_π : List (G × G), a key(k₀, k₁)is bad (isBadEvenMansourKey T_e T_π k) when some(x, y) ∈ T_eand(u, v) ∈ T_πcollide on the internal permutation input (x + k₀ = u) or output (y - k₁ = v). Outside this bad set, the internal permutation queries made through the cipher are disjoint in both domain and range from the direct queries toπ(disjoint_of_isBadEvenMansourKey_eq_false), and whenT_eandT_πare consistent withevenMansourEquiv π k₀ k₁andπ, output collisions reduce to input collisions (isBadKeyPair_eq_decide_of_evenMansourEquiv). Under a uniform two-key(k₀, k₁)or single keyk, the bad-key probability is at most2 * |T_e| * |T_π| / |G|(toOuterMeasure_isBadEvenMansourKey_toReal_le,toOuterMeasure_isBadSingleKeyEvenMansour_toReal_le). For any adaptive distinguisher satisfyingIsCallBounded program Q_e Q_π,OracleComp.IsCostBounded.transcript_cost_lebounds every supported transcript by|T_e| ≤ Q_eand|T_π| ≤ Q_π, yielding the2 * Q_e * Q_π / |G|bad-key bound on every supported execution path (IsCallBounded.badEvenMansourKey_toReal_le,IsCallBounded.badSingleKeyEvenMansour_toReal_le). The lazy-sampled bidirectional random-permutation coupling step connecting this bad-key intersection bound to full two-sidedGame.advantage (evenMansourRealGame program) (evenMansourIdealGame program)remains open.
Main definitions #
Cslib.Crypto.EvenMansour.evenMansourEncrypt,evenMansourDecrypt,evenMansourEquiv,singleKeyEvenMansourEquiv: Even–Mansour encryption, decryption, and bundled permutations.Cslib.Crypto.EvenMansour.preWhitenEquiv,postWhitenEquiv,preWhitenKeyRecoveryAttack,postWhitenKeyRecoveryAttack: single-whitening variants and 2-query key-recovery attacks.Cslib.Crypto.EvenMansour.PermQuery,PermOracleSpec,EvenMansourSpec,IsCallBounded: bidirectional cipher and primitive permutation oracle interface and separate query budgets.Cslib.Crypto.EvenMansour.evenMansourRealGame,singleKeyEvenMansourRealGame,evenMansourIdealGame: real and ideal bidirectional permutation games.Cslib.Crypto.EvenMansour.isBadKeyPair,isBadEvenMansourKey,isBadSingleKeyEvenMansour,transcriptCipher,transcriptPerm: bad-key collision predicates and transcript projections.
Main results #
Cslib.Crypto.EvenMansour.map_prod_evenMansourEncrypt_uniformOfFintype: one-query perfect secrecy and independence from the pre-whitening keyk₀.Cslib.Crypto.EvenMansour.advantage_preWhitenKeyRecoveryGame_eq,Cslib.Crypto.EvenMansour.advantage_postWhitenKeyRecoveryGame_eq: 2-query attacks achieve key-recovery game advantage1 - |G|⁻¹when either whitening key is omitted.Cslib.Crypto.EvenMansour.advantage_evenMansourRealGame_liftLeft_eq_zero,Cslib.Crypto.EvenMansour.advantage_evenMansourRealGame_liftRight_eq_zero: zero advantage when queries are restricted to one oracle.Cslib.Crypto.EvenMansour.toOuterMeasure_isBadEvenMansourKey_toReal_le,Cslib.Crypto.EvenMansour.toOuterMeasure_isBadSingleKeyEvenMansour_toReal_le,Cslib.Crypto.EvenMansour.IsCallBounded.badEvenMansourKey_toReal_le,Cslib.Crypto.EvenMansour.IsCallBounded.badSingleKeyEvenMansour_toReal_le: Boneh–Shoup Theorem 4.10 bad-key probability bound2 * Q_e * Q_π / |G|.
References #
Algebraic Even–Mansour cipher over an additive group #
Even–Mansour decryption: remove post-whitening key k₁, apply the inverse permutation π_inv,
and remove pre-whitening key k₀.
Instances For
Decryption inverts encryption whenever π_inv is a left inverse of π.
Encryption inverts decryption whenever π_inv is a right inverse of π.
The Even–Mansour cipher bundled as a permutation Equiv.Perm G.
Instances For
With zero whitening keys, the Even–Mansour cipher is the underlying permutation π.
Composing two Even–Mansour wrappers with the same permutation adds the whitening keys.
The inverse of an Even–Mansour cipher with keys (k₀, k₁) and permutation π is an
Even–Mansour cipher with keys (-k₁, -k₀) and inverse permutation π.symm.
Single-key Even–Mansour cipher (k₀ = k₁ = k, [DKS12]).
Instances For
Over a group of exponent two (∀ x : G, -x = x), Even–Mansour decryption is encryption under
the inverse permutation with the two keys swapped.
Over a group of exponent two (∀ x : G, -x = x), inverting the Even–Mansour permutation swaps
the pre-whitening and post-whitening keys.
Over BitString n, inverting the Even–Mansour permutation swaps k₀ and k₁.
For any fixed keys (k₀, k₁), wrapping a permutation π in Even–Mansour is a bijection on
Equiv.Perm G.
Instances For
One-query perfect secrecy #
For any fixed function π : G → G and input x : G, the map (k₀, k₁) ↦ (k₀, π(x + k₀) + k₁)
is a bijection on G × G.
Instances For
One-query perfect secrecy: for any fixed π : G → G and plaintext x : G, under uniform
independent keys (k₀, k₁), the pre-whitening key k₀ and the ciphertext
evenMansourEncrypt π k₀ k₁ x are independent and uniformly distributed on G × G.
Under uniform independent keys (k₀, k₁), a single Even–Mansour encryption of x is uniformly
distributed on G for every fixed π : G → G.
Necessity of both whitening keys (algebraic recovery) #
Even–Mansour with pre-whitening only (k₁ = 0): E(k₀, x) = π(x + k₀)
([BS23], Section 4.7).
Instances For
Even–Mansour with post-whitening only (k₀ = 0): E(k₁, x) = π(x) + k₁
([BS23], Section 4.7).
Instances For
Key recovery for preWhitenEquiv: given y = E(k₀, x) and u = π⁻¹(y), recover
k₀ = -x + u.
Instances For
A single encryption query y = preWhitenEquiv π k₀ x and inverse permutation query π.symm y
recover k₀ deterministically.
Key recovery for postWhitenEquiv: given y = E(k₁, x) and v = π(x), recover
k₁ = -v + y.
Instances For
A single encryption query y = postWhitenEquiv π k₁ x and forward permutation query π x
recover k₁ deterministically.
Bidirectional ideal-permutation oracle interface and games #
Instances For
The oracle specification of a bidirectional permutation on G.
Instances For
Answer a bidirectional permutation query using P : Equiv.Perm G.
Instances For
The combined oracle interface in the Even–Mansour security experiment ([BS23],
Section 4.7): left queries (.inl) call the cipher permutation E and right queries (.inr)
call the public primitive permutation π.
Instances For
An adversary program makes at most Q_e cipher queries and at most Q_π primitive
permutation queries on every execution path.
Instances For
A program making at most Q_e cipher queries and Q_π primitive queries makes at most
Q_e + Q_π total queries.
Query the cipher permutation in the forward direction (x ↦ E(x)).
Instances For
Query the cipher permutation in the inverse direction (y ↦ E⁻¹(y)).
Instances For
Query the public primitive permutation in the forward direction (u ↦ π(u)).
Instances For
Query the public primitive permutation in the inverse direction (v ↦ π⁻¹(v)).
Instances For
Deterministically evaluate a program against cipher permutation E and primitive permutation
π.
Instances For
Deterministically evaluate a program in the real Even–Mansour world with public permutation π
and keys (k₀, k₁).
Instances For
Oracle attack recovering k₀ from preWhitenEquiv π k₀ in 1 cipher query and 1 primitive
query: query y ← E(x) and u ← π⁻¹(y), then return -x + u.
Instances For
preWhitenKeyRecoveryAttack x makes at most 1 cipher query and 1 primitive query.
Against preWhitenEquiv π k₀ and π, preWhitenKeyRecoveryAttack x deterministically returns
k₀.
Oracle attack recovering k₁ from postWhitenEquiv π k₁ in 1 cipher query and 1 primitive
query: query y ← E(x) and v ← π(x), then return -v + y.
Instances For
postWhitenKeyRecoveryAttack x makes at most 1 cipher query and 1 primitive query.
Against postWhitenEquiv π k₁ and π, postWhitenKeyRecoveryAttack x deterministically
returns k₁.
The real Even–Mansour security experiment ([BS23], Section 4.7): sample a uniform
permutation π ← Equiv.Perm G and uniform independent keys (k₀, k₁) ← G × G, and run program
against evenMansourEquiv π k₀ k₁ and π.
Instances For
The single-key Even–Mansour security experiment ([DKS12]): sample a uniform
permutation π ← Equiv.Perm G and a single uniform key k ← G, and run program against
singleKeyEvenMansourEquiv π k and π.
Instances For
The ideal Even–Mansour security experiment: sample two independent uniform permutations
E, π ← Equiv.Perm G and run program against E and π.
Instances For
For any adversary program that queries only the cipher oracle (liftLeft program), the real
Even–Mansour game is identically distributed to the ideal game.
Any adversary that queries only the cipher oracle (liftLeft) has zero advantage between the
real Even–Mansour game and the ideal game.
For any adversary program that queries only the primitive permutation oracle
(liftRight program), the real Even–Mansour game is identically distributed to the ideal game.
Any adversary that queries only the primitive permutation oracle (liftRight) has zero
advantage between the real Even–Mansour game and the ideal game.
2-query oracle attacks when either whitening key is omitted #
Key-recovery game for pre-whitening-only Even–Mansour: draw π ← Equiv.Perm G and
k₀ ← G, run preWhitenKeyRecoveryAttack x against preWhitenEquiv π k₀ and π, and test
whether it outputs k₀.
Instances For
Ideal comparison game for preWhitenKeyRecoveryAttack: draw independent uniform permutations
E, π ← Equiv.Perm G and a uniform target key k₀ ← G, and test whether
preWhitenKeyRecoveryAttack x outputs k₀.
Instances For
In the real pre-whitened game, preWhitenKeyRecoveryAttack x succeeds with probability 1.
In the ideal game, preWhitenKeyRecoveryAttack x outputs the uniform target k₀ with
probability |G|⁻¹.
2-query break of pre-whitening-only Even–Mansour ([BS23], Section 4.7):
omitting post-whitening (k₁ = 0) allows a 2-query attack (1 cipher query + 1 primitive query)
to achieve key-recovery game advantage 1 - |G|⁻¹.
Key-recovery game for post-whitening-only Even–Mansour: draw π ← Equiv.Perm G and
k₁ ← G, run postWhitenKeyRecoveryAttack x against postWhitenEquiv π k₁ and π, and test
whether it outputs k₁.
Instances For
Ideal comparison game for postWhitenKeyRecoveryAttack: draw independent uniform permutations
E, π ← Equiv.Perm G and a uniform target key k₁ ← G, and test whether
postWhitenKeyRecoveryAttack x outputs k₁.
Instances For
In the real post-whitened game, postWhitenKeyRecoveryAttack x succeeds with probability
1.
In the ideal game, postWhitenKeyRecoveryAttack x outputs the uniform target k₁ with
probability |G|⁻¹.
2-query break of post-whitening-only Even–Mansour ([BS23], Section 4.7):
omitting pre-whitening (k₀ = 0) allows a 2-query attack (1 cipher query + 1 primitive query)
to achieve key-recovery game advantage 1 - |G|⁻¹.
Bad-key transcript intersection analysis (Boneh–Shoup Theorem 4.10) #
A key pair k = (k₀, k₁) is bad for a cipher input-output pair e = (x, y) and a primitive
permutation input-output pair p = (u, v) if the internal permutation input x + k₀ collides with
u or the internal permutation output y - k₁ collides with v
([BS23], Section 4.7, Theorem 4.10).
Instances For
A key pair k = (k₀, k₁) is bad for a cipher transcript T_e : List (G × G) and a primitive
permutation transcript T_π : List (G × G) if some e ∈ T_e and p ∈ T_π collide on the
internal permutation input or output ([BS23], Section 4.7, Theorem 4.10).
Instances For
Single-key specialization (k₀ = k₁ = k, [DKS12]) of the Even–Mansour
bad-key predicate.
Instances For
Input-only bad-key predicate (x + k₀ = u for some (x, y) ∈ T_e and (u, v) ∈ T_π), which
captures all collisions in the real Even–Mansour world where y = π(x + k₀) + k₁ and
v = π(u).
Instances For
Domain and range disjointness outside bad keys: when
isBadEvenMansourKey T_e T_π k = false, every cipher pair (x, y) ∈ T_e has internal permutation
input x + k₀ distinct from every primitive query input u in T_π, and internal permutation
output y - k₁ distinct from every primitive query output v in T_π.
When e = (x, y) is consistent with evenMansourEquiv π k₀ k₁ (π (x + k₀) + k₁ = y) and
p = (u, v) is consistent with π (π u = v), an output collision y - k₁ = v is equivalent to
an input collision x + k₀ = u.
On a pair (e, p) consistent with evenMansourEquiv π k.1 k.2 and π, isBadKeyPair e p k
reduces to the input collision decide (e.1 + k.1 = p.1).
On transcripts T_e and T_π consistent with evenMansourEquiv π k.1 k.2 and π,
isBadEvenMansourKey T_e T_π k equals isBadInputKey T_e T_π k.1.
Exact single-pair collision probabilities and multi-query union bounds #
For a single pair (e, p), a uniform key pair k ← G × G satisfies isBadKeyPair e p k with
probability at most 2 * |G|⁻¹.
For a single pair (e, p), a single uniform key k ← G satisfies isBadKeyPair e p (k, k)
with probability at most 2 * |G|⁻¹.
Boneh–Shoup Theorem 4.10 bad-key union bound (ℝ≥0∞): for any cipher transcript T_e and
primitive permutation transcript T_π, a uniform key pair (k₀, k₁) ← G × G is bad with
probability at most 2 * |T_e| * |T_π| * |G|⁻¹.
Boneh–Shoup Theorem 4.10 bad-key union bound (ℝ): for any cipher transcript T_e and
primitive permutation transcript T_π, a uniform key pair (k₀, k₁) ← G × G is bad with real
probability at most 2 * |T_e| * |T_π| / |G|.
Single-key Even–Mansour bad-key union bound (ℝ≥0∞, [DKS12]): for any
cipher transcript T_e and primitive permutation transcript T_π, a single uniform key k ← G is
bad with probability at most 2 * |T_e| * |T_π| * |G|⁻¹.
Single-key Even–Mansour bad-key union bound (ℝ, [DKS12]): for any
cipher transcript T_e and primitive permutation transcript T_π, a single uniform key k ← G is
bad with real probability at most 2 * |T_e| * |T_π| / |G|.
Input-collision union bound (ℝ): for any cipher transcript T_e and primitive transcript
T_π, a uniform pre-whitening key k₀ ← G triggers an input collision isBadInputKey T_e T_π k₀
with real probability at most |T_e| * |T_π| / |G|.
Adaptive distinguisher transcript bounds via IsCallBounded #
Project a logged EvenMansourSpec G query-response entry onto its cipher input-output pair
(x, y) (turning .inverse y with answer x into (x, y)), or none for primitive queries.
Instances For
Project a logged EvenMansourSpec G query-response entry onto its primitive permutation
input-output pair (u, v) (turning .inverse v with answer u into (u, v)), or none for
cipher queries.
Instances For
The list of cipher input-output pairs recorded in a bidirectional interaction transcript.
Instances For
The list of primitive permutation input-output pairs recorded in a bidirectional interaction transcript.
Instances For
The length of transcriptCipher T equals the total cipherCost of T.
The length of transcriptPerm T equals the total permCost of T.
Against any stateful bidirectional oracle, a supported run of program with
IsCallBounded program Q_e Q_π records at most Q_e cipher pairs.
Against any stateful bidirectional oracle, a supported run of program with
IsCallBounded program Q_e Q_π records at most Q_π primitive permutation pairs.
Boneh–Shoup Theorem 4.10 for adaptive call-bounded distinguishers (two-key): on any
supported transcript T of a distinguisher satisfying IsCallBounded program Q_e Q_π, a uniform
key pair (k₀, k₁) ← G × G is bad with real probability at most 2 * Q_e * Q_π / |G|.
Boneh–Shoup Theorem 4.10 for adaptive call-bounded distinguishers (single-key): on any
supported transcript T of a distinguisher satisfying IsCallBounded program Q_e Q_π, a single
uniform key k ← G is bad with real probability at most 2 * Q_e * Q_π / |G|.