Symmetric 对称加密
Basics:
- Key Space contains all set of possible keys
Substitution Cypher 替换加密
- Key Space = 26
- key's the chart itself
Cryptanalysis 破密
主要攻击方式:
- 仅密文
- 密文+明文
- 可选明密文组合
实施攻击
- 数学分析
- 暴力破解
- 侧信道分析
大 记 忆 恢 复 术社会工程学- 人性是最大的弱点
柯克霍夫原则:
即使敌手得知全部细节,无key不得道!security by obsecurity
——晦涩的安全
Modular Arithmetic 模算术
asymmetric ciphers (public keys-非对称算法)
12 / 9 = 1 ... 3
12 = 9 * 1 + 3
12 = 3 mod 9
带鱼余除法
1 m - gcd(a, m) = 1
coprime互素
恺撒密码
Caesar:移位
Monoalphabetic:替换26字母表
Vigenere:W + A = X
Affine 仿射密码
Stream 流式加密
Stream Cypher v.s. Block Cypher
- Stream:逐比特进行
- Block:逐块进行
Stream Cypher 实践
- 原理:
运算(模2加法) - 过程可复现
那流加密的密钥应该如何科学产生呢?详见下……
随机数和无漏洞流加密
True Ranodm Number Generators
- from random physic process
- thermal noise, pic pixels;
- mouse moving, key stroking...
- Output cannot be reproduced
- Generation of nonces (临时值/新鲜随机数)
Pesudorandom Number Generators
- linear congruential 线性同余
从学术开始,以仕途结束,这是中国知识分子的毛病之一。
CryptoGraphyhttps://coderama.top/posts/2025/250920
赞赏博主