2013-11-21 71 views

回答

2

這只是使用PKCS1填充時的要求。 「裸體」RSA雖然不夠安全,但它可以完成長度最大的密鑰大小,並且OAEP填充取決於您正在使用的哈希算法。

the PKCS1 spec

Steps: 

    1. Length checking: If mLen > k - 11, output "message too long" and 
     stop. 

    2. EME-PKCS1-v1_5 encoding: 

     a. Generate an octet string PS of length k - mLen - 3 consisting 
     of pseudo-randomly generated nonzero octets. The length of PS 
     will be at least eight octets. 

     b. Concatenate PS, the message M, and other padding to form an 
     encoded message EM of length k octets as 

      EM = 0x00 || 0x02 || PS || 0x00 || M. 

作爲每至少11個字節被預置到明文。 0x00和0x02,然後是PS,其長度爲「至少八個八位字節」,然後是0x00。所以3 + 8 = 11。