Skip to main content

Perfect Secrecy

Definition​

An encryption scheme (Gen,Enc,Dec)(Gen, Enc, Dec) with message space M\mathcal{M} is perfectly secret if for every probability distribution for MM, every message m∈Mm \in \mathcal{M}, and every ciphertext c∈Cc \in \mathcal{C} for which Pr[C=c]>0Pr[C = c] > 0:

Pr[M=m∣C=c]=Pr[M=m].(1)Pr[M = m | C = c] =Pr[M = m]. \tag{1}

(The requirement that Pr[C=c]>0Pr[C = c] > 0 is a technical one needed to prevent conditioning on a zero probability event.)

This definition implies that in a perfectly secret encryption scheme, the ciphertext cc reveals no information about the plaintext mm. Specifically, for any message mm within the message space M\mathcal{M} and any possible ciphertext cc in the ciphertext space C\mathcal{C}, the probability of mm being the plaintext corresponding to cc is exactly the same as the probability of mm being chosen without any knowledge of cc.

Other notions of Perfect Secrecy​

There are two other notions of perfect secrecy which are articulated through the following two lemmas:

Lemma 1: An encryption scheme (Gen,Enc,Dec)(Gen, Enc, Dec) with message space M\mathcal{M} is perfectly secret if and only if the following equation holds for every m,mβ€²βˆˆMm,m' \in \mathcal{M} and every c∈Cc \in \mathcal{C}

Pr[EncK(m)=c]=Pr[EncK(mβ€²)=c].Pr[Enc_K(m) = c] =Pr[Enc_K(m') = c].

Proof:

Part 1: Pr[M=m∣C=c]=Pr[M=m]⟹Pr[EncK(m)=c]=Pr[EncK(mβ€²)=c].Pr[M = m | C = c] =Pr[M = m] \Longrightarrow Pr[Enc_K(m) = c] =Pr[Enc_K(m') = c].

According to Bayes' theorem

Pr[M=m∣C=c]⏟=Pr[M=m]β‹…Pr[C=c]=Pr[C=c∣M=m]β‹…Pr[M=m]β€…β€ŠβŸΉβ€…β€ŠPr[C=c]=Pr[C=c∣M=m]β€…β€ŠβŸΉβ€…β€ŠPr[C=c]=Pr[C=c∣M=mβ€²]\begin{align*} \underbrace{Pr[M = m | C = c]}_{=Pr[M = m]} \cdot Pr[C = c] &=Pr[C = c | M = m] \cdot Pr[M = m]\\ \implies Pr[C = c] =Pr[C = c | M = m] \tag{A}\\ \implies Pr[C = c] =Pr[C = c | M = m'] \tag{B}\\ \end{align*}

Also,

Pr[C=c∣M=m]=Pr[EncK(M)=c∣M=m]Β byΒ definition,=Pr[EncK(m)=c∣M=m],=Pr[EncK(m)=c]Β asΒ KΒ isΒ independentΒ ofΒ Mβ€…β€ŠβŸΉβ€…β€ŠPr[C=c∣M=mβ€²]=Pr[EncK(mβ€²)=c]\begin{align*} Pr[C = c | M = m ] &= Pr[Enc_K(M) = c|M=m]\hspace{3px}\text{ by definition},\\ &= Pr[Enc_K(m) = c|M=m],\\ &= Pr[Enc_K(m) = c]\hspace{3px}\text{ as K is independent of M}\tag{C}\\ \implies Pr[C = c | M = m'] &= Pr[Enc_K(m') = c]\tag{D} \end{align*}

Using (A), (B), (C) and (D), we get

Pr[EncK(m)=c]=Pr[EncK(mβ€²)=c].\begin{align*} Pr[Enc_K(m) = c] =Pr[Enc_K(m') = c]. \end{align*}

Part 2: Pr[M=m∣C=c]=Pr[M=m]⟸Pr[EncK(m)=c]=Pr[EncK(mβ€²)=c].Pr[M = m | C = c] =Pr[M = m] \Longleftarrow Pr[Enc_K(m) = c] =Pr[Enc_K(m') = c].

Pr[EncK(m)=c]=Pr[C=c∣M=m],andΒ Pr[EncK(mβ€²)=c]=Pr[C=c∣M=mβ€²]Β byΒ definition.\begin{align*} Pr[Enc_K(m) = c]&=Pr[C = c | M = m ],\\ \text{and } Pr[Enc_K(m') = c]&=Pr[C = c | M = m']\hspace{3px}\text{ by definition}. \end{align*}

Because of the premise, we have

Pr[C=c∣M=m]=Pr[C=c∣M=mβ€²].\begin{align*} Pr[C = c | M = m ]=Pr[C = c | M = m'].\tag{E} \end{align*}

We know that

Pr[C=c]=βˆ‘m∈MPr[C=c∣M=m]β‹…P[M=m],=Pr[C=c∣M=m1]β‹…P[M=m1]+Pr[C=c∣M=m2]β‹…P[M=m2]+...+Pr[C=c∣M=m∣M∣]β‹…P[M=m∣M∣],=Pr[C=c∣M=m]β‹…βˆ‘m∈MP[M=m]⏟=1Β usingΒ (E),=Pr[C=c∣M=m].\begin{align*} Pr[C = c]&=\sum_{m\in \mathcal{M}}Pr[C = c | M = m]\cdot P[M=m],\\ &=Pr[C = c | M = m_1]\cdot P[M=m_1] + Pr[C = c | M = m_2]\cdot P[M=m_2] +...+Pr[C = c | M = m_{|M|}]\cdot P[M=m_{|M|}],\\ &=Pr[C = c | M = m]\cdot\underbrace{\sum_{m\in \mathcal{M}}P[M=m]}_{=1}\hspace{3px}\text{ using (E)},\\ &=Pr[C = c | M = m]. \tag{F} \end{align*}

Using Bayes' theorem

Pr[C=c∣M=m]β‹…P[M=m]=Pr[M=m∣C=c]β‹…P[C=c],β€…β€ŠβŸΉβ€…β€ŠP[M=m]=Pr[M=m∣C=c]Β usingΒ (F).\begin{align*} Pr[C = c | M = m]\cdot P[M=m] &= Pr[M = m | C = c]\cdot P[C=c],\\ \implies P[M=m] &= Pr[M = m | C = c]\hspace{3px}\text{ using (F).} \end{align*}

β– \hspace{480px}\blacksquare

Lemma 2:

OTP is Perfectly Secret​

We will use definition (1)(1) to prove that One Time Pad is perfectly secret.

Given:
K=M=C={0,1}l,\mathcal{K}=\mathcal{M}=\mathcal{C}=\{0,1\}^l, where ll is the length of message mm,

Pr[C=c∣M=m]=Pr[KβŠ•m=c∣M=m],=Pr[K=mβŠ•c∣M=m],=Pr[K=mβŠ•c]Β asΒ KΒ isΒ independentΒ ofΒ M,=12l.\begin{align*} Pr[C = c | M = m] &=Pr[K \oplus m = c | M = m],\\ &= Pr[K = m \oplus c | M = m],\\ &= Pr[K = m \oplus c] \hspace{3px}\text{ as K is independent of M},\\ &=\frac{1}{2^l}. \tag{2} \end{align*} Pr[C=c]=βˆ‘m∈MPr[C=c∣M=m]β‹…Pr[M=m]Β usingΒ lawΒ ofΒ totalΒ probabilty,=βˆ‘m∈M12lβ‹…Pr[M=m],=12lβ‹…βˆ‘m∈MPr[M=m],=12lβ‹…1.\begin{align*} Pr[C = c ] &=\sum_{m \in \mathcal{M} }Pr[C = c | M = m]\cdot Pr[M = m] \hspace{3px}\text{ using law of total probabilty},\\ &= \sum_{m \in \mathcal{M} }\frac{1}{2^l}\cdot Pr[M = m] ,\\ &= \frac{1}{2^l}\cdot \sum_{m \in \mathcal{M} } Pr[M = m] ,\\ &=\frac{1}{2^l}\cdot 1. \tag{3} \end{align*}

Now we will use Bayes' theorem of conditional probability:

Pr[C=c∣M=m]=Pr[C=cΒ andΒ M=m]Pr[M=m],Pr[M=m∣C=c]=Pr[C=cΒ andΒ M=m]Pr[C=c],β€…β€ŠβŸΉβ€…β€ŠPr[M=m∣C=c]=Pr[C=c∣M=m]β‹…Pr[M=m]Pr[C=c],\begin{align*} Pr[C = c | M = m ] &= \frac{Pr[C = c \text{ and } M = m]} {Pr[M = m]},\\ Pr[M = m | C = c ] &= \frac{Pr[C = c \text{ and } M = m]} {Pr[C = c]},\\ \implies Pr[M = m | C = c ] &= \frac{Pr[C = c | M = m ]\cdot Pr[M = m]} {Pr[C = c]},\\ \end{align*}

using (2)(2) and (3)(3),

Pr[M=m∣C=c]=Pr[C=c].β– \begin{align*} Pr[M = m | C = c ] &= Pr[C = c].\hspace{10px}\blacksquare\\ \end{align*}

An inherent limitation exists in crafting an encryption scheme that achieves perfect secrecy, which is encapsulated by the following theorem:

Shannon's Theorem for Perfect Secrecy​

Theorem: If (Gen,Enc,Dec)(Gen, Enc, Dec) is a perfectly secret encryption scheme with message space M\mathcal{M} and key space K\mathcal{K}, then ∣K∣β‰₯∣M∣|\mathcal{K}|\geq|\mathcal{M}|.

Proof:

  • Assume the contrary: i.e., ∣K∣<∣M∣|\mathcal{K}| < |\mathcal{M}| and the scheme is still perfectly secret
  • Fix any message m0m_0, and any key k0k_0. Let
c0=Enck0(m0)β€…β€ŠβŸΉβ€…β€ŠPr[EncK(m0)=c0]>0c_0=Enc_{k_0}(m_0)\\ \implies Pr[Enc_K(m_0)=c_0]>0
  • What happens if we decrypt c0c_0 with each key one by one?
    We get a set of messages, which we denote by:
S={Dec(c0,k):k∈K}S=\{Dec(c_0,k):k \in \mathcal{K}\}
  • Note that ∣Sβˆ£β‰€βˆ£K∣|S|\leq|\mathcal{K}| and K<M\mathcal{K}<\mathcal{M}
β€…β€ŠβŸΉβ€…β€Šβˆ£S∣<∣M∣\implies |S|<|\mathcal{M}|
  • This means, there exists a message m1∈Mm_1 \in \mathcal{M} such that m1∉Sm_1 \not\in S
  • What happens if we encrypt m1m_1 with a key k∈Kk \in \mathcal{K}?
  • Since m1∉Sm_1 \not\in S, by definition:
βˆ€k∈k:Enck(m1)β‰ c0β€…β€ŠβŸΉβ€…β€ŠPr[EncK(m1)=c0]=0\forall k \in \mathcal{k}: Enc_k(m_1)\neq c_0\\ \implies Pr[Enc_K(m_1)=c_0]=0
  • Therefore, there exist m0,m1,c0m_0, m_1, c_0 such that:
Pr[EncK(mo)=c0]β‰ Pr[EncK(m1)=c0]Pr[Enc_K(m_o)=c_0] \neq Pr[Enc_K(m_1)=c_0]
  • This contradicts perfect secrecy.β– \hspace{20px}\blacksquare