Testing the Math
Here is a chance to test out how the math, and public-key encryption, work in practice.
I want to send you a message. And I want you to be able to verify that the message came from me. So I encrypt the message using my private key and send both the unencrypted version and the encrypted version of the message (a signed copy of the message).
There is nothing secret about the message - anyone who sees it knows what it says. But by checking to see if my public key will turn the encrypted message back into the original message, you can verify that it is really sent by me and that no one modified it.
For this to work, you need my public key. We will assume you already know that it my public key is: exponent: 3, clock-size: 34
. (If you did not have my key, you would need a trustworthy way to get a copy of it - in which case we would need something like a certification authority.)
I have sent you for different messages, each with an encrypted version. The messages are decimal numbers to make life easier for you. But a computer would of course be working with binary data.
Message | 5 | 4 | 15 | 8 |
---|---|---|---|---|
Encrypted Version | 11 | 30 | 12 | 2 |
To verify each message, you need to check if:
$message = (encryptedMessage)^{(keyExponent)} \textrm{ mod } keyClock$
If the right side of that equation does in fact equal the original message, you can trust the message is an unmodified message from me.
Try each of the four messages. Three should check out. One should not. (Hint: The first one should check out. If it does not, you are not setting up the math correctly.)
You can use Wolfram to help do the math:
You can click the black box below to reveal the answer and verify that you identified the forged message: