Documentation

CslibFrontier.Crypto.Protocols.Quantum.OneTimePad

The quantum one-time pad #

Alice and Bob share a uniformly random key (a, b) of 2n bits. To send an n-qubit state ρ over a public quantum channel, Alice applies the Pauli string X^a Z^b and sends X^a Z^b ρ (X^a Z^b)ᴴ (Cslib.Crypto.Protocols.Quantum.OneTimePad.encrypt); Bob undoes it with (X^a Z^b)ᴴ (Cslib.Crypto.Protocols.Quantum.OneTimePad.decrypt_encrypt). An eavesdropper who does not know the key holds the key-averaged state, which is the maximally mixed state 1 / 2ⁿ whatever ρ is (Cslib.Crypto.Protocols.Quantum.OneTimePad.averageCiphertext_eq), by the Pauli twirl (Cslib.Quantum.sum_pauliTwirl). So the channel reveals nothing about ρ (Cslib.Crypto.Protocols.Quantum.OneTimePad.averageCiphertext_eq_averageCiphertext): 2n bits of key suffice to hide n qubits (Ambainis, Mosca, Tapp, de Wolf, Theorem 4.1, without ancilla; de Wolf, Chapter 18, Exercise 5(b), for one qubit). AMTW apply a uniformly random tensor product of I, X, Y, Z; since Y = i X Z, each such operator equals some X^a Z^b up to a global phase, which cancels in the conjugation, so the two encryptions are the same channel.

Secrecy survives entanglement: if the plaintext register is part of a joint state ρ with a reference system that Eve may also hold, her key-averaged state is 1 / 2ⁿ ⊗ Tr_A ρ (Cslib.Crypto.Protocols.Quantum.OneTimePad.averageCiphertextWith_eq), so it depends only on the reference system's own state, and not on the plaintext or its correlations with the reference. This product form (full decoupling) is a standard strengthening of the remark in the proof of Theorem 4.1 that the twirled qubit is maximally mixed "no matter if it is entangled with other qubits".

This file proves the sufficiency of 2n key bits; the matching 2n-bit key-entropy lower bound (Ambainis, Mosca, Tapp, de Wolf, Corollary 5.4) is proved in CslibFrontier.Crypto.Protocols.Quantum.KeyLowerBound.

Main definitions #

Main results #

References #

@[reducible, inline]

The plaintext and ciphertext space: matrices on n = |ι| qubits.

noncomputable def Cslib.Crypto.Protocols.Quantum.OneTimePad.encrypt {ι : Type u_1} [Fintype ι] [DecidableEq ι] :
(ι → Bool) × (ι → Bool) → Op ι → Op ι

Encryption with the key (a, b): ρ ↦ X^a Z^b ρ (X^a Z^b)ᴴ.

noncomputable def Cslib.Crypto.Protocols.Quantum.OneTimePad.decrypt {ι : Type u_1} [Fintype ι] [DecidableEq ι] :
(ι → Bool) × (ι → Bool) → Op ι → Op ι

Decryption with the key (a, b): σ ↦ (X^a Z^b)ᴴ σ X^a Z^b.

theorem Cslib.Crypto.Protocols.Quantum.OneTimePad.decrypt_encrypt {ι : Type u_1} [Fintype ι] [DecidableEq ι] (k : (ι → Bool) × (ι → Bool)) (ρ : Op ι) :
decrypt k (encrypt k ρ) = ρ

Correctness: decryption with the same key recovers the plaintext.

Ciphertexts of states are states.

noncomputable def Cslib.Crypto.Protocols.Quantum.OneTimePad.averageCiphertext {ι : Type u_1} [Fintype ι] [DecidableEq ι] (ρ : Op ι) :
Op ι

The ciphertext averaged over a uniformly random key of 2n bits: the state of an eavesdropper who does not know the key.

theorem Cslib.Crypto.Protocols.Quantum.OneTimePad.averageCiphertext_def {ι : Type u_1} [Fintype ι] [DecidableEq ι] (ρ : Op ι) :
averageCiphertext ρ = (↑(Fintype.card ((ι → Bool) × (ι → Bool))))⁻¹ • ∑ k : (ι → Bool) × (ι → Bool), encrypt k ρ

The average ciphertext is tr ρ / 2ⁿ • 1.

The average ciphertext of any state is the maximally mixed state 1 / 2ⁿ.

Perfect secrecy: the eavesdropper's state is the same for every plaintext state.

Secrecy with a reference system #

noncomputable def Cslib.Crypto.Protocols.Quantum.OneTimePad.encryptWith {ι : Type u_1} {κ : Type u_2} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] :
(ι → Bool) × (ι → Bool) → Matrix ((ι → Bool) × κ) ((ι → Bool) × κ) ℂ → Matrix ((ι → Bool) × κ) ((ι → Bool) × κ) ℂ

Encryption of the first register of a joint state with a reference system κ: ρ ↦ (X^a Z^b ⊗ 1) ρ (X^a Z^b ⊗ 1)ᴴ.

theorem Cslib.Crypto.Protocols.Quantum.OneTimePad.encryptWith_def {ι : Type u_1} {κ : Type u_2} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] (a b : ι → Bool) (ρ : Matrix ((ι → Bool) × κ) ((ι → Bool) × κ) ℂ) :
encryptWith (a, b) ρ = Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) (Quantum.pauliString a b) 1 * ρ * (Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) (Quantum.pauliString a b) 1).conjTranspose
theorem Cslib.Crypto.Protocols.Quantum.OneTimePad.isDensityMatrix_encryptWith {ι : Type u_1} {κ : Type u_2} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] {ρ : Matrix ((ι → Bool) × κ) ((ι → Bool) × κ) ℂ} (hρ : Quantum.IsDensityMatrix ρ) (k : (ι → Bool) × (ι → Bool)) :

Joint ciphertexts of joint states are states.

noncomputable def Cslib.Crypto.Protocols.Quantum.OneTimePad.averageCiphertextWith {ι : Type u_1} {κ : Type u_2} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] (ρ : Matrix ((ι → Bool) × κ) ((ι → Bool) × κ) ℂ) :
Matrix ((ι → Bool) × κ) ((ι → Bool) × κ) ℂ

The key-averaged joint state of the ciphertext and the reference system.

theorem Cslib.Crypto.Protocols.Quantum.OneTimePad.averageCiphertextWith_eq {ι : Type u_1} {κ : Type u_2} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] (ρ : Matrix ((ι → Bool) × κ) ((ι → Bool) × κ) ℂ) :

Secrecy with a reference system: the key-averaged joint state is 1 / 2ⁿ ⊗ Tr_A ρ, a product of the maximally mixed state with the reference system's own state.

The eavesdropper's joint state with the reference system depends only on the reference system's own state Tr_A ρ: plaintexts with the same reduced state on the reference system are indistinguishable, even given the reference system.