cryptography
$$\newcommand{\setMessages}{\color{blue}{\mathcal{M}}}$$ $$\newcommand{\setCryptograms}{\color{blue}{\mathcal{C}}}$$ $$\newcommand{\setKeys}{\color{blue}{\mathcal{K}}}$$ $$\newcommand{\setEncryptions}{\color{blue}{\mathcal{E}}}$$ $$\newcommand{\setDecryptions}{\color{blue}{\mathcal{D}}}$$ $$\newcommand{\randomVariable}[1]{\color{blue}{\mathfrak{#1}}}$$ $$\newcommand{\function}[1]{\color{brown}{\mathtt{#1}}}$$ $$\newcommand{\Cybersecurity}{\color{blue}{\mathsf{Cybersecurity}}}$$ $$\newcommand{\InfoSec}{\color{blue}{\mathsf{InfoSec}}}$$ $$\newcommand{\Probability}{\color{blue}{\mathbb{P}\mathrm{rob}}}$$ $$\newcommand{\Alice}{\color{blue}{\mathtt{Alice}}}$$ $$\newcommand{\Bob}{\color{blue}{\mathtt{Bob}}}$$ $$\newcommand{\Charles}{\color{blue}{\mathtt{Charles}}}$$ $$\newcommand{\Evely}{\color{blue}{\mathtt{Evelyn}}}$$ $$x\in\mathbf{N}$$ $$x\in\mathcal{N}$$ $$x\in\mathbb{N}$$ $$x\in\mathsf{N}$$ $$\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$$ $$\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$$ $$\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$$ $$\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$$ $$\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$$ $$\mathsc{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$$ $$\mathnormal{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$$ $$\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$$ $$\mathit{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$$ $$\mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$$ $$\textsc{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}$$ $$x\in\mathsf{N}$$

Perfect Secrecy

Throughout this section, we assume that a cryptosystem \((\setMessages , \setCryptograms , \setKeys , \setEncryptions , \setDecryptions)\) is specified, and a particular key \(k \in \setKeys\) is used for only one encryption. Let us suppose that there is a probability distribution on the plaintext space, \(\setMessages\) . Thus the plaintext element defines a random variable, denoted \(\randomVariable{m}\). We denote the a priori probability that plaintext \(m\) occurs by \(\Probability[\randomVariable{m} = m ]\). We also assume that the key \(k\) is chosen (by \(\Alice\) and \(\Bob\)) using some fixed probability distribution (often a key is chosen at random, so all keys will be equiprobable, but this need not be the case). So the key also defines a random variable, which we denote by \(\randomVariable{k}\). Denote the probability that key \(k\) is chosen by \(\Probability[\randomVariable{k} = k]\). Recall that the key is chosen before Alice knows what the plaintext will be. Hence, we make the reasonable assumption that the key and the plaintext are independent random variables.

The two probability distributions on \(\setCryptograms\) and \(\setKeys\) induce a probability distribution on \(\setCryptograms\) . Thus, we can also consider the ciphertext element to be a random variable, say \(\randomVariable{c}\). It is not hard to compute the probability \(\Probability[\randomVariable{c} = c]\) that \(c\) is the ciphertext that is transmitted. For a key \(k\in\setKeys\), define

\[\function{C}(k) = \{e_{k}(m) :\forall m \in\setMessages\}.\]

That is, \(\function{C}(k)\) represents the set of possible ciphertexts if \(k\) is the key. Then, for every \(c \in \setCryptograms\) , we have that \(\Probability[\randomVariable{k} = k] = \sum_{k:c\in\function{C}(k)}^{123}{\Probability[\randomVariable{k} = k]\Probability[\randomVariable{c} = k]}\) ∑ Pr [ K = K ] Pr [ x = d K ( y )] . { K:y ∈ C ( K )}