What Is Public-Key Cryptography?
Public-key cryptography uses a pair of keys: one you share and one you keep private. Learn the role of each key.
Free video lesson · 1:17
What Is Public-Key Cryptography?
Quantum Computing & Encryption for Beginners
Music: “Thinking Music” by Kevin MacLeod. Creative Commons Attribution 4.0.
A public key can be shared while its matching private key is kept secret.
Read the video transcript
Public-key cryptography uses a pair of keys. One can be shared with everyone. The other stays private. They work together, but having the public one should not let someone work out the private one.
For sending a private message, picture a special box. Anyone can close it, but only its owner has the key that opens it. This is an analogy for one use of public-key cryptography.
Your friend shares their public key. You use it to protect a message for them. Their matching private key lets them open it. You never needed a copy of their private key to send the message.
There is one important catch: the public key must really belong to your friend. If a stranger tricks you into using their public key instead, you could protect the message for the wrong person.
So the useful idea is a pair with different jobs. Share the public part. Protect the private part. Systems built around these pairs can help people communicate without first sharing one secret key.
These pairs can also help check a message. Watch What Is a Digital Signature? For the quantum risk, watch Can Quantum Computers Break Encryption?
The short answer
Public-key cryptography uses a pair of keys. One can be shared with everyone. The other stays private. They work together, but having the public one should not let someone work out the private one.
A simple example
For sending a private message, picture a special box. Anyone can close it, but only its owner has the key that opens it. This is an analogy for one use of public-key cryptography.
Your friend shares their public key. You use it to protect a message for them. Their matching private key lets them open it. You never needed a copy of their private key to send the message.
There is one important catch: the public key must really belong to your friend. If a stranger tricks you into using their public key instead, you could protect the message for the wrong person.
So the useful idea is a pair with different jobs. Share the public part. Protect the private part. Systems built around these pairs can help people communicate without first sharing one secret key.
Share the right half
You can give other people your public key. The private key stays with you. Before using a public key, software also needs a trustworthy way to check whose key it is. A key pair by itself does not prove a human identity.
Check your understanding
Can you recover the private key just by reading the public key?
Answer
A secure public-key system is designed to make that calculation impractical. The keys are related, but the private one must remain secret.
Keep learning
Follow the free video course one question at a time. For help applying these ideas at work, explore team training or a cryptography audit.