Trapdoor function schemes and anonymous key exchange #
[BS23], Section 10.2 (Definition 10.2, pp. 400–401), defines a trapdoor function scheme
(G, F, I) with key generation G, public evaluation F(pk, ·) and secret-key inversion
I(sk, ·) satisfying I(sk, F(pk, x)) = x, together with its one-wayness game and security
notion (Attack Game 10.2 and Definition 10.3, p. 401; asymptotic form in Definition 10.4,
pp. 402–403). Section 10.2.1 and Figure 10.1 (pp. 401–402) construct an anonymous two-party
key-exchange protocol from any trapdoor function scheme: Alice samples (pk, sk) ← G() and sends
pk; Bob samples x ← X uniformly, sends y ← F(pk, x) and outputs x; Alice outputs
I(sk, y). Section 10.2.1 (p. 402) shows that for a correct scheme, one-wayness
(TrapdoorFunction.OneWay) implies key-guessing security (KeyExchange.AnonKESecure), since any
key-guessing adversary directly breaks one-wayness with the exact same advantage; we also prove the
converse direction, which is original here and immediate because the two adversary conversions are
mutually inverse, giving the equivalence keyExchange_anonKESecure_iff_oneWay. The RSA
instantiation (§10.3 and §10.3.1) is in
CslibFrontier/Crypto/Computational/TrapdoorFunction/RSA.lean.
Main definitions #
Cslib.Crypto.TrapdoorFunction,Cslib.Crypto.TrapdoorFunction.Correct: trapdoor function schemes with key-dependent domainX pkand rangeY pk, and their inversion correctness ([BS23], Definition 10.2, pp. 400–401).Cslib.Crypto.TrapdoorFunction.Transcript,Cslib.Crypto.TrapdoorFunction.encTranscript: public pairs(pk, y)and their framed tuple encoding.Cslib.Crypto.TrapdoorFunction.Inverter,Cslib.Crypto.TrapdoorFunction.Inverter.IsPPT,Cslib.Crypto.TrapdoorFunction.owGame,Cslib.Crypto.TrapdoorFunction.OneWay: typed inverters, their uniform strict-PPT predicate, Attack Game 10.2 and one-wayness ([BS23], p. 401 and pp. 402–403).Cslib.Crypto.TrapdoorFunction.keyExchangeExecution,Cslib.Crypto.TrapdoorFunction.keyExchange: the Figure 10.1 anonymous key-exchange protocol ([BS23], Section 10.2.1, pp. 401–402).Cslib.Crypto.TrapdoorFunction.keGuesserToInverter,Cslib.Crypto.TrapdoorFunction.inverterToKEGuesser: mutually inverse conversions between key-guessing adversaries againstkeyExchangeandInverters (with PPT preservationCslib.Crypto.TrapdoorFunction.isPPT_keGuesserToInverterandCslib.Crypto.TrapdoorFunction.isPPT_inverterToKEGuesser).
Main results #
Cslib.Crypto.TrapdoorFunction.keyExchange_correct:keyExchange TisKeyExchange.Correctwhen everyT nisCorrect([BS23], Section 10.2.1, p. 402).Cslib.Crypto.TrapdoorFunction.Correct.anonKEGame_keyExchange: for aCorrectscheme,anonKEGameonkeyExchange TwithadversaryequalsowGameonT nwithkeGuesserToInverter adversary n([BS23], Section 10.2.1, p. 402).Cslib.Crypto.TrapdoorFunction.keyExchange_anonKESecure_iff_oneWay: for aCorrectfamilyT,keyExchange TsatisfiesAnonKESecureif and only ifTsatisfiesOneWay(theOneWay → AnonKESecuredirection is [BS23], Section 10.2.1, p. 402; the converse is original here viainverterToKEGuesser).
Implementation notes #
- Key-dependent domain and range: [BS23], Definition 10.2 (p. 400), fixes two sets
XandY, then notes in Section 10.3 (pp. 404–405) that RSA requires sets indexed by the public key (Fin pk.N) and leaves that generalization unstated. HereX Y : PK → Typeare key-dependent throughout, sorsaTrapdooris a direct instance without auxiliary wrappers; constant familiesfun _ => X₀recover Definition 10.2 verbatim. - Key distribution and
domain_nonempty:keyGen : PMF SKrepresents the key law directly (matchingRSAGen,PrimeOrderGroupFamilysetup laws andKeyExchange.execute), andpublicKey : SK → PKprojects the public key (a pair-outputting generatorGcorresponds toSK = PK × SK₀withpublicKey = Prod.fst).domain_nonemptyrequiresX (publicKey sk)to be nonempty for keyssk : SK, rather than at arbitrary malformedpk : PK(such as RSA'sN = 0).owGameandkeyExchangeExecutiontake[∀ pk, Fintype (X pk)]. - Unbundled correctness and honest-party efficiency:
Correctis unbundled fromTrapdoorFunction, matchingKeyExchange.Correct. Moreover, Definition 10.4's items 1–5 (pp. 402–403)—efficient recognizability and sampleability ofX, efficient recognizability ofY, and polynomial-time algorithmsG,F,I—are not bundled here and remain tracked under #5657.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Section 10.2 (Definitions 10.2–10.4, Attack Game 10.2, Section 10.2.1, Figure 10.1, pp. 400–403) and Section 10.3 (key-dependent domain remark, pp. 404–405).
A trapdoor function scheme (G, F, I) ([BS23], Section 10.2, Definition 10.2,
pp. 400–401) with public keys PK, secret keys SK, and key-dependent domain X pk and range
Y pk (Section 10.3, pp. 404–405).
- keyGen : PMF SK
Key-generation distribution
Gover secret keys. - publicKey : SK → PK
The public key determined by a secret key.
- eval (pk : PK) : X pk → Y pk
Evaluation
F(pk, ·)on the domain ofpk. Trapdoor inversion
I(sk, ·)recovering an element ofX (publicKey sk).Every public key arising from a secret key has a nonempty domain.
Inversion correctness ([BS23], Section 10.2, Definition 10.2, p. 401):
I(sk, F(pk, x)) = x for every secret key in the support of keyGen and every x in the
domain.
For a Correct trapdoor function scheme, F(pk, ·) is injective for every sk in the
support of keyGen ([BS23], Section 10.2, p. 401).
The public pair (pk, y) seen by an inverter in Attack Game 10.2 and by a passive
eavesdropper in Figure 10.1 ([BS23], Section 10.2 and Section 10.2.1, pp. 401–402).
The encoding of a trapdoor-function Transcript: framed encPK publicKey followed by
encY publicKey ciphertext (encTranscript_apply).
A typed inverter for Attack Game 10.2 ([BS23], Section 10.2, p. 401, with security
parameter n as in Definition 10.4, pp. 402–403): given n, a public key pk and y : Y pk,
it outputs a candidate preimage in X pk.
An inverter is PPT when one uniform strict PPT machine reads (1ⁿ, pk, y) encoded by
encPair encUnary (encTranscript encPK encY) and writes encX pk x'.
View a key-guessing adversary against trapdoor-function key exchange as an Inverter in
Attack Game 10.2 ([BS23], Section 10.2.1, p. 402).
View an Inverter in Attack Game 10.2 as a key-guessing adversary against trapdoor-function
key exchange (the inverse of keGuesserToInverter, added here for the converse direction of
keyExchange_anonKESecure_iff_oneWay).
keGuesserToInverter preserves uniform strict PPT efficiency.
inverterToKEGuesser preserves uniform strict PPT efficiency.
Attack Game 10.2 ([BS23], Section 10.2, p. 401): draw sk ← T.keyGen, draw x
uniformly from X (T.publicKey sk), run step (T.publicKey sk) (T.eval (T.publicKey sk) x) and
accept when its output equals x. Its advantage OWadv[A, T] is
(T.owGame (A n)).succProbability.
One-wayness of a family of trapdoor function schemes ([BS23], Section 10.2,
Attack Game 10.2 and Definition 10.3, p. 401, with Definition 10.4, pp. 402–403): every PPT
inverter recovers a uniform preimage from (pk, F(pk, x)) with negligible probability.
Deviations from the source: the domain X pk and range Y pk may depend on the public key
(the form Section 10.3 names for RSA and does not adopt, pp. 404–405); keys come from any
PMF SK family without bundling the efficient recognizability, sampleability or polynomial-time
G, F, I conditions of Definition 10.4, items 1–5 (#5657); and inverters are uniform strict
PPT machines reading (1ⁿ, pk, y) via encPair encUnary (encTranscript encPK encY) and writing
encX pk x.
Anonymous key exchange from a trapdoor function scheme #
Honest execution of anonymous key exchange using a trapdoor function scheme T
([BS23], Section 10.2.1 and Figure 10.1, pp. 401–402): Alice draws sk ← T.keyGen and
sends pk = T.publicKey sk; Bob draws x uniformly from X pk, computes y = T.eval pk x,
sends y and outputs x; Alice computes and outputs T.invert sk y.
Anonymous two-party key exchange built from a family T of trapdoor function schemes
([BS23], Section 10.2.1 and Figure 10.1, pp. 401–402).
When every T n is Correct, Alice's inverted key I(sk, F(pk, x)) equals Bob's chosen x
([BS23], Section 10.2.1, p. 402).
For a scheme family T that is Correct at parameter n, running anonKEGame on
keyExchange T with adversary gives the exact same game as running (T n).owGame with
keGuesserToInverter adversary n ([BS23], Section 10.2.1, p. 402).
Anonymous key exchange from a correct trapdoor function scheme is key-guessing secure if and only if the scheme is one-way.
[BS23], Section 10.2.1 (p. 402), proves the OneWay → AnonKESecure direction (mpr),
observing that any adversary guessing x from (pk, y) breaks Attack Game 10.2 with the exact
same advantage (Correct.anonKEGame_keyExchange). The converse direction (mp), and hence the
equivalence, is original here and follows immediately because keGuesserToInverter and
inverterToKEGuesser are mutually inverse.