Classical Cryptography

Introduction

Definition

A cryptosystem is a five-tuple $\mathcal{(P,C,K,E,D)}$, where the following conditions are satisfied:

  1. $\mathcal{P}$ is a finite set of possible plaintexts;
  2. $\mathcal{C}$ is a finite set of possible ciphertexts;
  3. $\mathcal{K}$, the keyspace, is a finite set of possible keys;
  4. $d_K(e_K(x))=x$

Cryptosystem

Shift Cipher

$e_K(x)=x+K\mod26$

Substitution Cipher

$e_{\pi}(x)=\pi(x)$

Affine Cipher

$e_K(x)=ax+b\mod26$

The Vigenere Cipher

$e_K(x_1, x_2, \cdots,x_m)=(x_1+k_1,x_2+k_2,\cdots,x_m+k_m)\mod 26$

Hill Cipher

$e_K(x_1, x_2, \cdots,x_m)=(x_1, x_2, \cdots,x_m) \begin{pmatrix} k_{1,1}&k_{1,2}&\cdots&k_{1,m}\\ k_{2,1}&k_{2,2}&\cdots&k_{2,m}\\ \vdots&\vdots&&\vdots\\ k_{m,1}&k_{m,2}&\cdots&k_{m,m} \end{pmatrix}$