概论
- 密码系统:
- 所有可能秘钥组成的集合
- 所有可能明文组成的集合
- 所有可能密文组成的集合
- 密码:
- : 加密算法
- : 解密算法
- 一致性原则:
- 通常 是一个随机化算法
- 一定是一个确定化算法
OTP (One Time Pad)
PRG 伪随机数生成器
- 高效,确定,不可预测
流密码
A stream cipher is a symmetric key cipher where plaintext digits are combined with a pseudorandom cipher digit stream (keystream). In a stream cipher, each plaintext digit is encrypted one at a time with the corresponding digit of the keystream, to give a digit of the ciphertext stream.
RC4
- 初始化
- 秘钥参与S盒的生成
- 伪随机子密码生成算法
- 按字节操作,每次通过一定算法定位S盒中一个元素,与输入异或得到密文
ChaCha
分组密码
a block cipher is a deterministic algorithm operating on fixed-length groups of bits, called a block, with an unvarying transformation that is specified by a symmetric key
DES
RC5
AES/Rijndael
Rijndael是一个分组密码算法族,其分组长度包括128比特、160比特、192比特、224比特、256比特,密钥长度也包括这五种长度,但是最终AES只选取了分组长度为128比特,密钥长度为128比特、192比特和256比特的三个版本
密码散列函数
单向函数,极其难以由散列函数输出的结果回推输入的数据是什么
MD-5
输出128位
SHA-1
1995,160位,已被攻破
SHA-2
2001, SHA-224、SHA-256、SHA-384、SHA-512、SHA-512/224、SHA-512/256
SHA-3
2015
非对称加密
RSA
ECC
圆锥曲线
代数编码
- maximum-likelihood decoding: has the least weight
- binary symmetric channel
- Block codes
- -block code
- -code
- encoding function:
- decoding function:
- codeword: element in image of ()
- Hamming distance:
- weight:
- correcting:
- detecting:
- combined:
- 冗余度:
- 编码率:
- -block code
- Group code: code that is also a subgroup of
- Linear code: A linear code of length n is a linear subspace of the vector space
-
- is a group code
-
-
- 循环码:线性码满足任一码字左移或右移一位后,得到的仍然是该码的一个码字
- 码多项式:把码组中各码元作为多项式系数
- (n,m) 循环码每个码字在以 为模运算的剩余类中某一类
- 生成多项式
- 常数项为 的 次多项式
- 的因式
- 其它码多项式为其倍式
- 不唯一
Parity-Check
- canonical parity check matrix:
- give rise to an -block code
- standard generator matrix:
- equals the minimum number of linearly dependent columns of
- is a single error-detecting code if and only if no column of consists entirely of zeros
- is a single error-correcting code if and only if does not contain any zero columns and no two columns of are identical
- Syndrone Decoding
- syndrone of :
- if the syndrome of is equal to some column of , say the ith column, then the error has occurred in the ith bit
- Coset Decoding (Standard Decoding)
- -linear code has cosets
- coset leader: an n-tuple of least weight in a coset
- and are in the same coset
- Correcting one error: -code
- Detecting one error: -code
卷积码
- 卷积码
- 将当前 比特信息编码为 个比特
- 前 信息段
- 解码
- 代数解码:大数逻辑解码
- 概率解码:维特比解码
- 将接收到的信号序列和所有可能的发送信号序列比较,选择其中汉明距离最小的序列认为是当前发送信号序列
- 最大似然
- 动态规划