Characterizations of perfect security (Boneh–Shoup §2.1.2) #
The equivalent forms of perfect security that [BS23], v0.6, §2.1.2 (printed pp. 8–12)
states for Shannon ciphers, on the information-theoretic encryption schemes EncScheme.
A Shannon cipher (E, D) over (K, M, C) with its uniformly random key is
EncScheme.ofPure (uniformOfFintype K) enc dec h, where h is the book's correctness property
D(k, E(k, m)) = m. Its CiphertextIndist (equal ciphertext laws for any two messages) is the
book's Definition 2.1 (perfect security, p. 8): two laws on C are equal exactly when they give
every ciphertext the same mass. The library's PerfectlySecret is instead the posterior form of
[KL20], Definition 2.3; perfectlySecret_iff_ciphertextIndist converts between
the two, so every result below also characterizes PerfectlySecret.
The ciphertext law of a deterministic scheme is the image of its key law
(ciphertextDist_ofPure), and under a uniform key the mass of c given m is the number of keys
taking m to c over |K| (ciphertextDist_ofPure_uniformOfFintype_apply): the identity
P_c = N_c / |K| in the proof of Theorem 2.1 (p. 9).
All of this is information-theoretic: there is no adversary and no resource bound.
Main results #
ciphertextIndist_ofPure_uniformOfFintype_iff: Theorem 2.1, (i) ⇔ (ii) (pp. 8–9). Condition (iii) of that theorem isCiphertextIndistitself.ciphertextIndist_ofPure_uniformOfFintype_of_existsUnique: the criterionN_c = 1(one key for each message and ciphertext) by which the book proves Theorem 2.2 and Example 2.7.ciphertextIndist_iff_forall_toOuterMeasure: Theorem 2.3 (pp. 10–11) for every scheme, with eventsS : Set Cin place of predicates onC.ciphertextIndist_iff_jointDist_eq_mul: Theorem 2.4 (pp. 11–12) for every scheme and one message law of full support.
Deviations from [BS23] #
- The book assumes
K,MandCfinite (§2.1.1, p. 5). Here onlyKis finite and nonempty, which the uniform key law needs;MandCare arbitrary types, in one universe withKasEncScheme.ofPurerequires. - Theorems 2.3 and 2.4 are stated for every
EncScheme: randomized encryption and any key law. The book's case isofPure (uniformOfFintype K) enc dec h. - In Theorem 2.1 (ii) the integer
N_cis a natural number, as a count of keys is. - In Theorem 2.3 the book's predicates
φonCare eventsS : Set C. - Theorem 2.4 is stated as one equivalence for a message law of full support. The book's first
half holds for every message law; that is
indep_of_ciphertextIndist. - Independence in Theorem 2.4 is the factorization
Pr[m = m ∧ c = c] = Pr[m = m] · Pr[c = c]of the joint law, not Mathlib'sProbabilityTheory.IndepFun.
References #
The ciphertext law of a deterministic scheme is the image of its key law under E(·, m).
Under a uniformly random key, a deterministic scheme sends m to c with probability the
number of keys k with E(k, m) = c, divided by |K|. This is the identity P_c = N_c / |K| in
the proof of [BS23], Theorem 2.1 (p. 9).
Counting criterion for perfect security: [BS23], Theorem 2.1, (i) ⇔ (ii)
(pp. 8–9). A Shannon cipher with a uniform key is perfectly secure (Definition 2.1) if and only if,
for every ciphertext c, the number of keys k with E(k, m) = c is the same for all messages
m.
The book takes K, M, C finite and N_c an integer; here only K is finite (and nonempty)
and N_c is a natural number. Condition (iii) of the theorem, that the laws of E(k, m) agree for
all m, is CiphertextIndist itself. perfectlySecret_iff_ciphertextIndist converts the left side
to the library's PerfectlySecret.
One key per message and ciphertext: a Shannon cipher with a uniform key in which, for every
message m and ciphertext c, exactly one key encrypts m to c is perfectly secure
(Definition 2.1). This is the case N_c = 1 of Theorem 2.1 (ii), by which [BS23] proves
the one-time pad perfectly secure (Theorem 2.2, p. 9) and the additive one-time pad (Example 2.7,
p. 10).
Perfect security as equal event probabilities: [BS23], Theorem 2.3 (pp. 10–11),
generalized from Shannon ciphers with a uniform key to every scheme, with randomized encryption and
any key law. A scheme has equal ciphertext laws for any two messages if and only if every event
S on ciphertexts has the same probability under any two messages.
The book's predicates φ on C are the events S = {c | φ c}; its statement is the case
scheme = ofPure (uniformOfFintype K) enc dec h, where CiphertextIndist is Definition 2.1. The
theorem is Mathlib's PMF.toOuterMeasure_inj read for the ciphertext laws: what it adds is the
book's formulation, not a new argument. As in the book's proof, the converse needs only singleton
events.
Perfect security as independence of message and ciphertext: [BS23], Theorem 2.4
(pp. 11–12), for every scheme and one message law msgDist that gives every message nonzero
probability. The message is drawn from msgDist and, independently, the key from the scheme's key
law; the scheme has equal ciphertext laws for any two messages if and only if message and ciphertext
are independent, written as Pr[m = m ∧ c = c] = Pr[m = m] · Pr[c = c], the form the book's proof
uses.
The book states the theorem for Shannon ciphers with a uniform key, the case
scheme = ofPure (uniformOfFintype K) enc dec h. Its first half, that perfect security gives
independence, holds for every message law and is indep_of_ciphertextIndist; full support
is used only for the converse, which is the book's second half. The converse is false without it:
the identity cipher on Bool with a point-mass message law satisfies the factorization and is not
CiphertextIndist.