文章目录
1.1 Cryptography and Modern Cryptography
区别 | 古典密码学 | 现代密码学 |
---|---|---|
定义 | Art | Science |
理论支持 | Little Theory | Rich Theory |
关注点 | Secret Communication | Encryption、Message Authentication、Digital Signature、Secure Protocol |
应用领域 | Military | Everywhere |
1.2 The Setting of Private-Key Encryption
The overview of cryptography
(A)Symmetric Encryption
Symmetric Encryption:加密和解密使用相同的密钥
ASymmetric Encryption:加密和解密使用不同的密钥
The Synax of Encryption
- Key Generation(Gen): Gen()是一个概率算法,根据方案定义的某种分布选择并输出密钥k
- Encryption Algorithm(Enc): 输入为密钥k和明文m,输出密文c, 记作 c : = E n c ( k , m ) c:=Enc(k,m) c:=Enc(k,m)或者 c ← E n c ( k , m ) c \leftarrow Enc(k,m) c←Enc(k,m),前者表示确定性算法,后者表示概率算法
- Decryption Algorithm(Dec): 输入密文c和密钥k,输出明文m,记作 m : = D e c ( k , c ) m:=Dec(k,c) m:=Dec(k,c)
以上算法必须满足: D e c k ( E n c k ( m ) ) = m Dec_k(Enc_k(m))=m Deck(Enck(m))=m
Kerckhoff’s Principle
The cipher method must not be required to be secret, and it must be able to fall into the hands of the enemy without inconvenience.
1.3 Historical Ciphers and Their Cryptanalysis
1.Caesar’s Cipher: 对每个字符循环移动3位,即
c
:
=
(
m
+
3
)
%
26
c:=(m+3)\%26
c:=(m+3)%26。
2.Shift Cipher: 这是改进版的Caesar’s Cipher,对每个字符循环移动k位,即
c
i
=
(
m
i
+
k
)
%
26
c_i=(m_i+k)\%26
ci=(mi+k)%26,其中
k
∈
{
0
,
…
,
25
}
k\in\{0,\dots,25\}
k∈{0,…,25}
3. The mono-alphabetic substitution cipher(单字母替换): 明文字符和密文字符形成了一一映射的关系 => Key Space = 26!。