PKCS1_SignatureScheme_PSS

本文详细介绍了RSASSA-PSS和RSASSA-PKCS1-v1_5两种RSA签名方案,以及对应的EMSA-PSS编码方法。RSASSA-PSS适用于新的应用,利用EMSA-PSS进行编码,而RSASSA-PKCS1-v1_5则用于向后兼容。签名生成和验证过程涉及到消息的哈希、RSA加解密以及特定的编码规则,确保了数据的安全性。

8. Signature Scheme with Appendix

简称RSASSA

Two signature schemes with appendix are specified in this document:

  • RSASSA-PSS,适用于新应用,使用EMSA-PSS编码封装方案;
  • RSASSA-PKCS1-v1_5,处理旧应用兼容性,使用EMSA-PKCS1-v1_5编码封装方案。

To verify a signature constructed with this type of scheme, it is necessary to have the message itself.

签名和验签,其实就是加密和解密,不同的是两种签名的封装方案(Section 9)。

8.1. RSASSA-PSS

8.1.1. Signature Generation

RSASSA-PSS-SIGN (K, M)
    K signer’s RSA private key
    M message to be signed, an octet string
Output:
    S signature, an octet string of length k, where k is the length in octets of the RSA modulus n

一般明文M是一段hash。

Steps:

  1. EMSA-PSS encoding
EM = EMSA-PSS-ENCODE (M, modBits - 1);
# Note that the octet length of EM will be one less than k if  modBits - 1 is divisible by 8 and equal to k otherwise.
  1. RSA signature:
m = OS2IP (EM);
s = RSASP1 (K, m);
S = I2OSP (s, k);
  1. Output the signature S

8.1.2. Signature Verification Operation

 RSASSA-PSS-VERIFY ((n, e), M, S)
 Input:
     (n, e) signer’s RSA public key
     M message whose signature is to be verified, an octet string
     S signature to be verified, an octet string of length k, where k is the length in octets of the RSA modulus n
Output:
	"valid signature" or "invalid signature"

Steps:

  1. Length checking: S

  2. RSA verification:

s = OS2IP (S);
m = RSAVP1 ((n, e), s);
EM = I2OSP (m, emLen);
  1. EMSA-PSS verification
Result = EMSA-PSS-VERIFY (M, EM, modBits - 1);
# Note that emLen will be one less than k if modBits - 1 is divisible
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值