网络信息安全:数字签名
什么是数字签名
一种认证机制,使得消息的产生者可以添加一个起签名作用的码字。通过计算消息的散列值并用产生者的私钥加密散列值来生成签名。签名保证了消息的来源和完整性。
目的:使明文信息的接收者能够验证信息确实来自合法用户,以及确认发送者身份。
数字签名的基本要求
- The signature must be a bit pattern that depends on the message being signed.
- The signature must use some information unique to the sender to prevent both forgery and denial
- It must be relatively easy to produce the digital signature
- It must be relativelt easy to reconginize and verify the digital signature
- It must be computationally infeasible to forge a digital signature, either by constructing a new message for an existing digital signature or by constructing a fraudulent digital signature for a given message
- It must be practical to retain a copy of the disital signature in storage
数字签名和消息认证的区别
消息认证使消息接收方验证消息发送方发送的内容有无被修改过,对防止第三者破坏足够,但收发双方有利害冲突时就无法解决纷争,需要更严格的手段,即数字签名
基本形式
两种方法
- 对消息整体的签字
- 对消息摘要的签字
两类
- 确定性数字签名,明文和签名一对一
- 概率性数字签名,明文和签名一对多
认证协议
证实信息交换过程有效性和合法性的一种手段,包括对通信对象的认证(身份认证)和报文内容的认证(报文认证),起到对数据完整性的保护
- 信息的真实性
- 存储数据的真实性
- 接收方提供回执
- 发送方不可否认
- 时效性和公证可能性
认证方法
单向认证
双向认证
重放攻击
合法的签名消息被拷贝后重新送出
解决方法
- 使用序列号
- 使用时间戳
- 挑战/应答
ELGmal数字签名方法
若AA为签署mm,,AA随机选择∈[0,p−1][0,p−1],gcd(k,p−1)=1gcd(k,p−1)=1,
计算r=αkr=αk modmod pp
计算rr modmod pp,XAXA modmod pp
即XArXArααksks modmod pp
则 modmod p−1p−1
根据此式求ss,则对于m的数字签名即为(r,s)
例题
验证:给定m,r,s容易计算 modmod p=p= YAYArr modmod pp,看其是否一致,k不能重复使用
例:p=17,α=3,=2,XBXB=5,m=11,k=5,求签名及验证
签名:r=αkr=αk modmod pp = modmod 17=517=5,
11=(2×5+5s)11=(2×5+5s) modmod 1616 = (10+5s)(10+5s) modmod 1616
5s5s modmod 16=1,s=1316=1,s=13
所以签名是(5,13)
验证:αα mm p=3p=31111 modmod 17=1017=1022 modmod 17=717=7
YAYArr modmod pp = 551313 modmod 17=717=7