Course contentsShow
← Computer Science
Lesson 2435 of 2,87254. Cryptography FundamentalsFree lesson

RSA Digital Signature Scheme

How RSA is used for signing: signing with private key, verification with public key.

RSA Digital Signature Scheme

What you'll learn: How RSA enables you to prove you authored a message using private-key signing and public-key verification.

The Core Idea

You've learned RSA for encryption: encrypt with the public key, decrypt with the private key. Digital signatures flip this relationship around—you sign with your private key, and anyone can verify with your public key.

Think of it like a wax seal on a medieval letter. Only you have the unique signet ring (private key) to press into the wax, but anyone who knows what your seal looks like (public key) can verify the letter really came from you.

How RSA Signing Works

Signing:

  1. Hash the message to create a fixed-size digest (e.g., using SHA-2)
  2. "Encrypt" the hash with your private key (d, n) — this produces the signature
  3. Send both the original message and the signature

Verification:

  1. Receiver hashes the message independently
  2. "Decrypts" your signature using your public key (e, n)
  3. Compares the decrypted hash to their computed hash
  4. If they match, the signature is valid—proving you signed it and the message wasn't altered

Why This Works

Only someone with the private key could have created a signature that decrypts correctly with the corresponding public key. The hash ensures the signature is tied to this specific message—changing even one bit produces a completely different hash, breaking the signature.

Key Takeaway: RSA digital signatures reverse the encryption flow—sign with private key to prove authenticity, verify with public key to confirm the signer's identity and message integrity.