2 ms·
You need to "pad" the number that will be signed so that it's the right size and shape to fit, or else bad guys can choose for you to sign a number that makes i
by tialaramex 8y ago
You need to "pad" the number that will be signed so that it's the right size and shape to fit, or else bad guys can choose for you to sign a number that makes it very easy to find your private key by looking at the signature which is clearly a terrible outcome.
Remember RSA is just very simple maths, done with huge numbers. If you pick the right "huge" numbers things that look hard become very easy indeed. So we need to ensure we never pick them.
The correct way to do this, which a lot of systems haven't adopted yet, is called RSA-PSS, the Probabilistic Signature Scheme. PSS has a proof that says if you believe RSA works, and assume certain other reasonable things, this is actually safe.
Before RSA-PSS (and still today in lots of backwards compatible systems), people used PKCS#1 v1.5 which has a scheme somebody threw together to do some padding but without any great insight. There is no security proof for PKCS#1 v1.5, it's probably safe, ish, but we can't be sure.
- consp 8y ago> There is no security proof for PKCS#1 v1.5, it's probably safe As long as you avoid the known problems, it probably is safe for signatures and the main problem now is that PSS is not included in lots of standards which thus require PKCS1_1v5. This prevents major implementation due to those standards not being updated fast enough. As an example of slow adoption: The HSMs i'm currently using only started native support for PSS last year, about 20 years after it's introduction. Please note that pkcs1_1v5 is never secure for encryption/decryption schemes.