Perfect Secrecy
Definitionβ
An encryption scheme ( G e n , E n c , D e c ) (Gen, Enc, Dec) ( G e n , E n c , Dec ) with message space M \mathcal{M} M is perfectly secret if for every probability distribution for M M M , every message m β M m \in \mathcal{M} m β M , and every ciphertext c β C c \in \mathcal{C} c β C for which P r [ C = c ] > 0 Pr[C = c] > 0 P r [ C = c ] > 0 :
P r [ M = m β£ C = c ] = P r [ M = m ] . (1) Pr[M = m | C = c] =Pr[M = m]. \tag{1} P r [ M = m β£ C = c ] = P r [ M = m ] . ( 1 )
(The requirement that P r [ C = c ] > 0 Pr[C = c] > 0 P r [ 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 c c c reveals no information about the plaintext m m m . Specifically, for any message m m m within the message space M \mathcal{M} M and any possible ciphertext c c c in the ciphertext space C \mathcal{C} C , the probability of m m m being the plaintext corresponding to c c c is exactly the same as the probability of m m m being chosen without any knowledge of c c c .
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 ( G e n , E n c , D e c ) (Gen, Enc, Dec) ( G e n , E n c , Dec ) with message space M \mathcal{M} M is perfectly secret if and only if the following equation holds for every m , m β² β M m,m' \in \mathcal{M} m , m β² β M and every c β C c \in \mathcal{C} c β C
P r [ E n c K ( m ) = c ] = P r [ E n c K ( m β² ) = c ] . Pr[Enc_K(m) = c] =Pr[Enc_K(m') = c]. P r [ E n c K β ( m ) = c ] = P r [ E n c K β ( m β² ) = c ] .
Proof:
Part 1: P r [ M = m β£ C = c ] = P r [ M = m ] βΉ P r [ E n c K ( m ) = c ] = P r [ E n c K ( m β² ) = c ] . Pr[M = m | C = c] =Pr[M = m] \Longrightarrow Pr[Enc_K(m) = c] =Pr[Enc_K(m') = c]. P r [ M = m β£ C = c ] = P r [ M = m ] βΉ P r [ E n c K β ( m ) = c ] = P r [ E n c K β ( m β² ) = c ] .
According to Bayes' theorem
P r [ M = m β£ C = c ] β = P r [ M = m ] β
P r [ C = c ] = P r [ C = c β£ M = m ] β
P r [ M = m ] β
β βΉ β
β P r [ C = c ] = P r [ C = c β£ M = m ] β
β βΉ β
β P r [ C = c ] = P r [ 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*} = P r [ M = m ] P r [ M = m β£ C = c ] β β β
P r [ C = c ] βΉ P r [ C = c ] = P r [ C = c β£ M = m ] βΉ P r [ C = c ] = P r [ C = c β£ M = m β² ] β = P r [ C = c β£ M = m ] β
P r [ M = m ] ( A ) ( B ) β
Also,
P r [ C = c β£ M = m ] = P r [ E n c K ( M ) = c β£ M = m ] Β byΒ definition , = P r [ E n c K ( m ) = c β£ M = m ] , = P r [ E n c K ( m ) = c ] Β asΒ KΒ isΒ independentΒ ofΒ M β
β βΉ β
β P r [ C = c β£ M = m β² ] = P r [ E n c K ( 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*} P r [ C = c β£ M = m ] βΉ P r [ C = c β£ M = m β² ] β = P r [ E n c K β ( M ) = c β£ M = m ] Β byΒ definition , = P r [ E n c K β ( m ) = c β£ M = m ] , = P r [ E n c K β ( m ) = c ] Β asΒ KΒ isΒ independentΒ ofΒ M = P r [ E n c K β ( m β² ) = c ] β ( C ) ( D ) β
Using (A), (B), (C) and (D), we get
P r [ E n c K ( m ) = c ] = P r [ E n c K ( m β² ) = c ] . \begin{align*}
Pr[Enc_K(m) = c] =Pr[Enc_K(m') = c].
\end{align*} P r [ E n c K β ( m ) = c ] = P r [ E n c K β ( m β² ) = c ] . β
Part 2: P r [ M = m β£ C = c ] = P r [ M = m ] βΈ P r [ E n c K ( m ) = c ] = P r [ E n c K ( m β² ) = c ] . Pr[M = m | C = c] =Pr[M = m] \Longleftarrow Pr[Enc_K(m) = c] =Pr[Enc_K(m') = c]. P r [ M = m β£ C = c ] = P r [ M = m ] βΈ P r [ E n c K β ( m ) = c ] = P r [ E n c K β ( m β² ) = c ] .
P r [ E n c K ( m ) = c ] = P r [ C = c β£ M = m ] , andΒ P r [ E n c K ( m β² ) = c ] = P r [ 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*} P r [ E n c K β ( m ) = c ] andΒ P r [ E n c K β ( m β² ) = c ] β = P r [ C = c β£ M = m ] , = P r [ C = c β£ M = m β² ] Β byΒ definition . β
Because of the premise, we have
P r [ C = c β£ M = m ] = P r [ C = c β£ M = m β² ] . \begin{align*}
Pr[C = c | M = m ]=Pr[C = c | M = m'].\tag{E}
\end{align*} P r [ C = c β£ M = m ] = P r [ C = c β£ M = m β² ] . β ( E ) β
We know that
P r [ C = c ] = β m β M P r [ C = c β£ M = m ] β
P [ M = m ] , = P r [ C = c β£ M = m 1 ] β
P [ M = m 1 ] + P r [ C = c β£ M = m 2 ] β
P [ M = m 2 ] + . . . + P r [ C = c β£ M = m β£ M β£ ] β
P [ M = m β£ M β£ ] , = P r [ C = c β£ M = m ] β
β m β M P [ M = m ] β = 1 Β usingΒ (E) , = P r [ 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*} P r [ C = c ] β = m β M β β P r [ C = c β£ M = m ] β
P [ M = m ] , = P r [ C = c β£ M = m 1 β ] β
P [ M = m 1 β ] + P r [ C = c β£ M = m 2 β ] β
P [ M = m 2 β ] + ... + P r [ C = c β£ M = m β£ M β£ β ] β
P [ M = m β£ M β£ β ] , = P r [ C = c β£ M = m ] β
= 1 m β M β β P [ M = m ] β β Β usingΒ (E) , = P r [ C = c β£ M = m ] . β ( F ) β
Using Bayes' theorem
P r [ C = c β£ M = m ] β
P [ M = m ] = P r [ M = m β£ C = c ] β
P [ C = c ] , β
β βΉ β
β P [ M = m ] = P r [ 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*} P r [ C = c β£ M = m ] β
P [ M = m ] βΉ P [ M = m ] β = P r [ M = m β£ C = c ] β
P [ C = c ] , = P r [ M = m β£ C = c ] Β usingΒ (F). β
β \hspace{480px}\blacksquare β
Lemma 2:
OTP is Perfectly Secretβ
We will use definition ( 1 ) (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, K = M = C = { 0 , 1 } l , where l l l is the length of message m m m ,
P r [ C = c β£ M = m ] = P r [ K β m = c β£ M = m ] , = P r [ K = m β c β£ M = m ] , = P r [ K = m β c ] Β asΒ KΒ isΒ independentΒ ofΒ M , = 1 2 l . \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*} P r [ C = c β£ M = m ] β = P r [ K β m = c β£ M = m ] , = P r [ K = m β c β£ M = m ] , = P r [ K = m β c ] Β asΒ KΒ isΒ independentΒ ofΒ M , = 2 l 1 β . β ( 2 ) β
P r [ C = c ] = β m β M P r [ C = c β£ M = m ] β
P r [ M = m ] Β usingΒ lawΒ ofΒ totalΒ probabilty , = β m β M 1 2 l β
P r [ M = m ] , = 1 2 l β
β m β M P r [ M = m ] , = 1 2 l β
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*} P r [ C = c ] β = m β M β β P r [ C = c β£ M = m ] β
P r [ M = m ] Β usingΒ lawΒ ofΒ totalΒ probabilty , = m β M β β 2 l 1 β β
P r [ M = m ] , = 2 l 1 β β
m β M β β P r [ M = m ] , = 2 l 1 β β
1. β ( 3 ) β
Now we will use Bayes' theorem of conditional probability:
P r [ C = c β£ M = m ] = P r [ C = c Β andΒ M = m ] P r [ M = m ] , P r [ M = m β£ C = c ] = P r [ C = c Β andΒ M = m ] P r [ C = c ] , β
β βΉ β
β P r [ M = m β£ C = c ] = P r [ C = c β£ M = m ] β
P r [ M = m ] P r [ 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*} P r [ C = c β£ M = m ] P r [ M = m β£ C = c ] βΉ P r [ M = m β£ C = c ] β = P r [ M = m ] P r [ C = c Β andΒ M = m ] β , = P r [ C = c ] P r [ C = c Β andΒ M = m ] β , = P r [ C = c ] P r [ C = c β£ M = m ] β
P r [ M = m ] β , β
using ( 2 ) (2) ( 2 ) and ( 3 ) (3) ( 3 ) ,
P r [ M = m β£ C = c ] = P r [ C = c ] . β \begin{align*}
Pr[M = m | C = c ] &= Pr[C = c].\hspace{10px}\blacksquare\\
\end{align*} P r [ M = m β£ C = c ] β = P r [ C = c ] . β β
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 ( G e n , E n c , D e c ) (Gen, Enc, Dec) ( G e n , E n c , Dec ) is a perfectly secret encryption scheme with message space M \mathcal{M} M and key space K \mathcal{K} K , then β£ K β£ β₯ β£ M β£ |\mathcal{K}|\geq|\mathcal{M}| β£ K β£ β₯ β£ M β£ .
Proof:
Assume the contrary: i.e., β£ K β£ < β£ M β£ |\mathcal{K}| < |\mathcal{M}| β£ K β£ < β£ M β£ and the scheme is still perfectly secret
Fix any message m 0 m_0 m 0 β , and any key k 0 k_0 k 0 β . Let
c 0 = E n c k 0 ( m 0 ) β
β βΉ β
β P r [ E n c K ( m 0 ) = c 0 ] > 0 c_0=Enc_{k_0}(m_0)\\
\implies Pr[Enc_K(m_0)=c_0]>0 c 0 β = E n c k 0 β β ( m 0 β ) βΉ P r [ E n c K β ( m 0 β ) = c 0 β ] > 0
What happens if we decrypt c 0 c_0 c 0 β with each key one by one?
We get a set of messages, which we denote by:
S = { D e c ( c 0 , k ) : k β K } S=\{Dec(c_0,k):k \in \mathcal{K}\} S = { Dec ( c 0 β , k ) : k β K }
Note that β£ S β£ β€ β£ K β£ |S|\leq|\mathcal{K}| β£ S β£ β€ β£ K β£ and K < M \mathcal{K}<\mathcal{M} K < M
β
β βΉ β
β β£ S β£ < β£ M β£ \implies |S|<|\mathcal{M}| βΉ β£ S β£ < β£ M β£
This means, there exists a message m 1 β M m_1 \in \mathcal{M} m 1 β β M such that m 1 βΜΈ S m_1 \not\in S m 1 β ξ β S
What happens if we encrypt m 1 m_1 m 1 β with a key k β K k \in \mathcal{K} k β K ?
Since m 1 βΜΈ S m_1 \not\in S m 1 β ξ β S , by definition:
β k β k : E n c k ( m 1 ) β c 0 β
β βΉ β
β P r [ E n c K ( m 1 ) = c 0 ] = 0 \forall k \in \mathcal{k}: Enc_k(m_1)\neq c_0\\
\implies Pr[Enc_K(m_1)=c_0]=0 β k β k : E n c k β ( m 1 β ) ξ = c 0 β βΉ P r [ E n c K β ( m 1 β ) = c 0 β ] = 0
Therefore, there exist m 0 , m 1 , c 0 m_0, m_1, c_0 m 0 β , m 1 β , c 0 β such that:
P r [ E n c K ( m o ) = c 0 ] β P r [ E n c K ( m 1 ) = c 0 ] Pr[Enc_K(m_o)=c_0] \neq Pr[Enc_K(m_1)=c_0] P r [ E n c K β ( m o β ) = c 0 β ] ξ = P r [ E n c K β ( m 1 β ) = c 0 β ]
This contradicts perfect secrecy.β \hspace{20px}\blacksquare β