Course 2.3Lesson 3 of 3
Asymmetric encryption uses two different keys: a public key that anyone may have, and a private key that only its owner has. This lesson shows how the pair works, which key is used for what, and why it solves the problem of sharing a secret key.
Try the code and the simulations beside the lesson.
Think of a letter box in a front door. Anyone can push a letter through the slot. But only the person with the door key can open the box and read the letters. Asymmetric encryption works like that.
Each person has a key pair: two keys that are made together and belong together.
Data encrypted with a public key can only be decrypted with the matching private key. The public key cannot decrypt it, so it does not matter who has the public key.
Sam wants to send a private message to Lina.
To reply, Lina uses Sam's public key, and Sam decrypts with Sam's private key. Always use the receiver's keys.
In symmetric encryption, a secret key has to travel from one person to the other. In asymmetric encryption, no secret key ever travels. Only public keys are sent, and they are no use for decrypting. The private keys never leave their owners.
It also needs fewer keys in a group. Each person needs just one key pair, however many people they talk to.
How can one key lock and a different key unlock? Real methods use very large numbers, hundreds of digits long. The simulation and the program below use tiny numbers just to show the idea. The exam does not ask for this calculation. In the toy model, a message number is locked as with the public key, and unlocked as with the private key.
The program locks a short message, written as numbers, with the toy public key. It shows that locking again with the public key does not undo it, and that the private key brings the message back.
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Every lesson is open to read. Enrolling also lets you:
Log in to join the discussion.
Loading…
This lesson is free to read. Enroll free to keep your place and take the tests.