Cipher

# Cipher

##### Updated: December 1, 2020
Cryptography

A cipher is defined over the spaces of:

All Keys, $$\mathscr{K}$$

All Messages, $$\mathscr{M}$$

All Cipher texts, $$\mathscr{C}$$

Cipher (defined as a triple, $$(\mathscr{K}, \mathscr{M}, \mathscr{C})$$) as a pair of algorithms $$(\mathbf{E}, \mathbf{D})$$ where $$\mathbf{E}$$ represents the encryption algorithm and $$\mathbf{D}$$ represents the decryption algorithm.

$$\mathbf{E}: \mathscr{K} \times \mathscr{M} \rightarrow \mathscr{C}$$

and

$$\mathbf{D}: \mathscr{K} \times \mathscr{C} \rightarrow \mathscr{M}$$

Such that:

$$\forall m \in \mathscr{M}, k \in \mathscr{K}: \mathbf{D}(k, \mathbf{E}(k, m)) = m$$

$$\mathbf{E}$$ is often randomized

$$\mathbf{D}$$ is always deterministic

A cipher $$(\mathbf{E}, \mathbf{D})$$ has perfect secrecy if:

\forall m_{0}, m_{1} \in \mathscr{M} \, (|m_{0}| = |m_{1}|) \, and \, \forall c \in \mathscr{C} \\\
Pr[\mathbf{E}(k, m_{0}) = c] = Pr[\mathbf{E}(k, m_{1}) = c]

where $$k \leftarrow \mathscr{K}$$ (k is a randomly distributed key from $$\mathscr{K}$$)

In other words, if I was given a particular cipher text (encrypted message), I will have no idea which message originally created it since it could be any other message with equal probability.