Public-key cryptography · 04 Worked example

Public-key cryptography: worked example

A digital signature with small numbers, using the example RSA keys, to see how private and public keys work together.

Let us use the toy RSA keys from the RSA page: public key (n = 3233, e = 17), private key (d = 2753).

Signing

Anna wants to sign the message represented by the number 65. She uses her private key:

terminale
signature = 65^2753 mod 3233 = 588

Verifying

Bruno receives the message 65 and the signature 588. He uses Anna’s public key:

terminale
588^17 mod 3233 = 65   → matches the message: valid signature

If someone changed the message to 66 while keeping the signature 588, verification would still give 65, different from 66: the forgery would be detected. And without the private key nobody can compute the correct signature for 66.

Continue with
05 Weaknesses and attacks

Public-key cryptography: weaknesses and attacks

The man-in-the-middle attack, weak keys, side channels and the quantum threat: where public-key cryptography can fail.

↑