RSA Signature Schemes (PKCS#1 v1.5 and PSS)
What you'll learn: How RSA signatures work with two different padding schemes—the older PKCS#1 v1.5 and the modern, more secure PSS.
The Core Idea
When you sign data with RSA, you're not just encrypting a hash—you need padding to prevent attacks. Two major schemes exist:
PKCS#1 v1.5 is the older standard. It takes your message hash, adds some fixed padding bytes and algorithm identifiers, then performs the RSA signature operation. Think of it like putting your document in a standardized envelope before sealing it. It's deterministic: the same message always produces the same signature.
PSS (Probabilistic Signature Scheme) is the modern approach. It adds randomness to the padding process, making each signature unique even for identical messages. Imagine shuffling random confetti into your envelope each time—the sealed result differs every time, but verification still works. This randomness makes PSS more resistant to mathematical attacks.
Why It Matters
PKCS#1 v1.5 has survived decades of scrutiny, but theoretical vulnerabilities exist under certain conditions. PSS provides provable security under standard assumptions, eliminating entire classes of attacks. However, PKCS#1 v1.5 remains widespread in legacy systems due to its simplicity and compatibility.
During signature verification, both schemes reverse the process: apply the public key operation, remove padding, and compare the recovered hash to a freshly computed hash of the message.
Signing vs Encryption Padding
Remember: signature padding schemes differ from encryption padding (like OAEP). They serve different security goals and aren't interchangeable.
Key Takeaway: RSA signatures require padding schemes to be secure. While PKCS#1 v1.5 is older and deterministic, PSS is the modern standard offering probabilistic security with randomized padding—prefer PSS for new applications.