1. Hash函数特性
Hash函数是将任意长度的输入,映射为固定长度的输出:
通常
的取值为:128,160,256,512。
Hash函数应具有如下特性:
- Pre-image resistant:即已知
,根据
求
,需要
次尝试。
- 2nd pre-image resistance:已知
和
,找到另一个
使得
,需要
次尝试。
- Collision resistance:找到任意的
,使得
,需要
次尝试。
一个好的Hash函数,应表现得像一个random oracle。
密码学中Hash函数可用于:
- 签名:用 代替
- 密钥推导:由主key 推导keys
- Bit commitment, predictions:
- 消息认证:
2. random oracle
random oracle(RO)是将任意长度的消息映射为无限输出string。
支持的输入参数为
,其中
代表的是输入的消息,
代表希望的输出字符串的长度。
输出为
,为
长度的字符串。是独立且均匀分布的字符。
random oracle的输出是自洽的,即相同的输入,对应相同的输出。
random oracle没有internal collisions。
3. tranditional construction——Merkle-Damgård
4. sponge construction
被称为
-bit排列函数(同时也为extendable output function(XOF)),
,其中的
为bits of rate,
为bits of capacity(security parameter)。
4.1 sponge函数
sponge函数又可称为海绵函数,主要分为两个阶段:
- absorbing 吸收阶段。对应该阶段的为hash碰撞。
- squeezing 挤压阶段。对应该阶段的为周期性output。
论文 《Sponge functions》中sponge函数等的定义如下:
5. duplex construction
参考资料:
[1] Sponge functions
[2] Introduction to sponge-based cryptography Part 1: Keccak and SHA-3
[3] Cryptographic sponge functions
[4] 博客Fiat-Shamir heuristic(含实现)和Random oracle