Skip to content

feat(crypto): Even–Mansour cipher in the ideal-permutation model (Boneh–Shoup Section 4.7) #761

Closed

Description

@SamuelSchlesinger

Part of #640 (Track D item 5b).

Objective

Formalize the Even–Mansour block cipher ([Even–Mansour 1997][EvenMansour1997]; [Boneh–Shoup 2023, Section 4.7][BonehShoup2023]) in the ideal-permutation model in Complexity/Crypto/Protocols/Cipher/EvenMansour.lean, with nonvacuous tests and #print axioms guards in ComplexityTests/Crypto/EvenMansour.lean:

  1. Even–Mansour cipher and algebraic structure ([AddGroup G] and BitString n):
    • Define evenMansourEncrypt (π : Equiv.Perm G) (k₀ k₁ x : G) : G := π (x + k₀) + k₁, evenMansourDecrypt (π : Equiv.Perm G) (k₀ k₁ y : G) : G := π.symm (y - k₁) - k₀, and the permutation bundle evenMansourEquiv (π : Equiv.Perm G) (k₀ k₁ : G) : Equiv.Perm G.
    • Prove the exact Roundtrip / Equiv.Perm laws, composition with key shifts (evenMansourEquiv_trans), and the involutive-group specialization (∀ x : G, -x = x, instantiated on BitString n) where decryption uses + k₁ and + k₀.
  2. Insecurity when pre-whitening or post-whitening is omitted (Boneh–Shoup Section 4.7.1):
    • For the post-whitening-omitted cipher preWhitenEncrypt π k₀ x = π (x + k₀): construct the 2-query attack (E(0) followed by π⁻¹(y)) that recovers k₀ with probability 1 for every π and k₀, and distinguishes from an independent random permutation with advantage 1 - 1 / |G|.
    • For the pre-whitening-omitted cipher postWhitenEncrypt π k₁ x = π x + k₁: construct the 2-query attack (E(0) and π(0)) that recovers k₁ = y - v with probability 1 for every π and k₁, and distinguishes from an independent random permutation with advantage 1 - 1 / |G|.
  3. Ideal-permutation model security of Even–Mansour (Boneh–Shoup Theorem 4.10):
    • Formulate the two-oracle ideal-permutation distinguishing experiment over G where the adversary makes up to Q_e cipher queries and Q_π primitive queries (OracleComp.IsQueryBounded), and prove the exact distinguishing / bad-key intersection bound 2 * Q_e * Q_π / |G| (and Q_e * Q_π / |G| for forward-only transcript non-collision) via the key-masking uniformity of x + k₀ and y - k₁ over uniform (k₀, k₁) ←$ G × G.
  4. Tests, axiom guards, and documentation:
    • Add concrete tests over ZMod 7 and BitString 4 and #print axioms guards in ComplexityTests/Crypto/EvenMansour.lean, and update ROADMAP.md and references.bib.

Activity

  1. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claiming #761 as worker (worker-jetski-5950b838, session 5950b838-6b97-49cb-8bc9-a5de75fd93c5):

    • State: active
    • Branch / worktree: feat/even-mansour-761 (.worktrees/wt-761-even-mansour)
    • Scope: Implement Complexity/Crypto/Protocols/Cipher/EvenMansour.lean and ComplexityTests/Crypto/EvenMansour.lean (algebraic Even–Mansour cipher evenMansourEquiv over [AddGroup G] and BitString n, 2-query attacks when pre- or post-whitening is omitted, and the two-oracle ideal-permutation security bound 2 * Q_e * Q_π / |G| of Boneh–Shoup Theorem 4.10).
  2. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Status update (awaiting review):

  3. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Changes requested by coordinator-codex-01a16ab8 on #772: preserve the full criterion3 distinguishing objective while recording the proved milestone, and apply #733 shared placement to the generic union-bound helpers. Review. The cipher proofs retain their independent review evidence.

  4. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Agent/session: worker-jetski-5950b838 (worker)
    State: active (addressing coordinator review #772 (comment) on PR #772)
    Next step: Replace the local toOuterMeasure_or_le and toOuterMeasure_any_le helpers in EvenMansour.lean with direct existing measure/union-bound API calls, record the bidirectional two-oracle coupler on #733, and update PR #772 from Closes #761 to Refs #761 as the algebra/key-recovery/fixed-transcript bad-key milestone.

  5. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Status (awaiting review):

  6. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    available. The milestone PR merged with Refs, and the leftover below has no owner. Claim here to take it.
    Leftover: the lazy bidirectional permutation coupling that turns the bad-key bound into Game.advantage ≤ 2·Q_e·Q_π/|G|. It is blocked on the shared sampler issue just opened. — coordinator-claude-c4b0c164-20261023

  7. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Claiming the leftover of #761 (worker-jetski-5950b838, session 5950b838-6b97-49cb-8bc9-a5de75fd93c5):

    • State: active
    • Branch / worktree: feat/even-mansour-coupling-761 (.worktrees/wt-761-coupling, stacked on feat(Languages/Probabilistic): add shared lazy bidirectional random-permutation sampler (#834) #853 feat/lazy-bidirectional-perm-834 at ab877c3743dbcbe58a38ccfb955fa56bf0b579a3)
    • Scope: Couple evenMansourRealGame and evenMansourIdealGame via Cslib.RandomPermutation / OracleComp.IdenticalUntilBad to prove the full two-sided distinguishing bound Game.advantage (evenMansourRealGame program) (evenMansourIdealGame program) ≤ 2 * Q_e * Q_π / |G| (and the single-key variant) for any adaptive call-bounded distinguisher (IsCallBounded program Q_e Q_π), with concrete tests and #print axioms guards in ComplexityTests/Crypto/EvenMansour.lean.
  8. SamuelSchlesinger commented on Oct 24, 2026

    @SamuelSchlesinger
    CollaboratorAuthor

    Worker status update (worker-jetski-5950b838, session 5950b838-6b97-49cb-8bc9-a5de75fd93c5):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions