Asymmetric encryption uses two mathematically linked keys — a public key to lock (encrypt) data and a private key to unlock (decrypt) it. Unlike symmetric encryption, the keys are different, so you can share the public key freely without exposing the private one. GCSE Computer Science covers this as the basis for HTTPS and digital signatures.
Why was asymmetric encryption invented?
Symmetric encryption has one fundamental problem: both the sender and receiver must agree on the same key before communicating. Doing this securely over an untrusted network is nearly impossible — if you could send a key safely, you could already send your message safely. This is called the key distribution problem.
Asymmetric encryption solves it elegantly. The recipient generates a key pair — one public, one private — and publishes the public key openly. Anyone can encrypt a message with the public key, but only the holder of the private key can decrypt it. No prior secret needs to be shared.
How does a key pair work?
The two keys are generated together using a mathematical relationship. The specific mathematics involved (based on the difficulty of factoring very large numbers, in the RSA algorithm) is beyond GCSE, but the logical relationship is the important part.
Think of it like a padlock: the public key is an open padlock you hand to anyone. They lock their message using it. Only your private key — which you never share — can unlock it. Crucially, seeing the padlock (public key) does not reveal the key (private key).
| Key | Who has it | What it does |
|---|---|---|
| Public key | Anyone — freely distributed | Encrypts data sent TO the key owner |
| Private key | Key owner only — never shared | Decrypts data encrypted with the paired public key |
How does asymmetric encryption work step by step?
Scenario: Alice wants to send a confidential message to Bob.
- Bob generates a key pair: a public key and a private key.
- Bob publishes his public key — he might post it on a website, or send it to Alice directly. It does not matter if Eve intercepts it.
- Alice encrypts her message using Bob's public key.
- The encrypted ciphertext is transmitted. Eve can intercept it, but cannot decrypt it without Bob's private key.
- Bob decrypts the ciphertext using his private key and reads Alice's message.
No secret was ever transmitted. The only key that can decrypt the message never left Bob's device.
What is a digital signature and how does it use asymmetric keys?
A digital signature proves that a message came from a specific sender and has not been tampered with. It uses the private key to sign and the public key to verify — the reverse of encryption.
Signing a message:
- The sender creates a hash of the message (a fixed-length fingerprint of its content).
- The sender encrypts the hash with their private key — this encrypted hash is the digital signature.
- The message is sent along with the signature.
Verifying the signature:
- The receiver decrypts the signature using the sender's public key, recovering the hash.
- The receiver independently hashes the received message.
- If the two hashes match, the message is authentic (it came from the claimed sender) and unmodified (the content has not changed since it was signed).
| Step | Key used | Purpose |
|---|---|---|
| Sign | Sender's private key | Prove authenticity — only the sender can sign |
| Verify | Sender's public key | Confirm the signature — anyone can verify |
How does HTTPS use both symmetric and asymmetric encryption?
A full HTTPS connection uses both types of encryption in what is called a hybrid approach:
- Asymmetric encryption is used during the handshake to securely agree on a shared session key. The server sends its public key (inside a digital certificate). The client uses it to encrypt the session key.
- Symmetric encryption using that session key encrypts all subsequent data in the session.
This hybrid approach exists because asymmetric encryption is mathematically expensive — it would slow down the bulk transfer of data. Symmetric encryption is far faster for encrypting large amounts of data. Asymmetric encryption solves the key distribution problem; symmetric encryption then handles the data at speed.
What is a digital certificate and why does it matter?
A digital certificate is an electronic document issued by a trusted Certificate Authority (CA) that binds a public key to an identity (such as a website domain). Without certificates, an attacker could intercept a connection, substitute their own public key, and impersonate the server — a man-in-the-middle attack.
When your browser connects to a website, it checks:
- The certificate is signed by a trusted CA.
- The domain name on the certificate matches the website you intended to visit.
- The certificate has not expired.
The padlock icon in your browser's address bar indicates this check passed.
How does asymmetric compare with symmetric encryption?
| Feature | Symmetric | Asymmetric |
|---|---|---|
| Number of keys | One shared key | A public/private key pair |
| Speed | Fast | Slow (computationally expensive) |
| Key distribution | Hard — key must be shared securely | Easy — public key can be shared openly |
| Use in HTTPS | Bulk data encryption (after handshake) | Handshake and key exchange |
| Example algorithm | AES | RSA |
Frequently asked questions
Do I need to understand the mathematics behind RSA for GCSE?
No. At GCSE, you need to understand the concept of asymmetric encryption — that a public key encrypts and a private key decrypts (or vice versa for signatures) — and how this solves the key distribution problem. The mathematical foundations (prime factorisation, modular arithmetic) are a university-level topic.
Can the public key decrypt data encrypted with the public key?
No. Data encrypted with the public key can only be decrypted by the corresponding private key. The public key cannot reverse its own encryption — this asymmetry is precisely what makes the scheme secure. In digital signatures, the process is reversed: the private key encrypts the hash, and the public key verifies it.
What is the key distribution problem in simple terms?
If you and a friend want to use a secret code, you both need to know the code before you start. But how do you agree on the code without your enemies overhearing? That is the key distribution problem. Asymmetric encryption solves it by letting you publish an open padlock (public key) — your friend locks their message with it, and only your private key can open it.
Why is symmetric encryption still used if asymmetric encryption is more secure?
Asymmetric encryption is not necessarily "more secure" — it solves a different problem. Symmetric encryption with a strong key (like AES-256) is extremely secure and very fast. Asymmetric encryption solves key distribution but is far slower. The practical solution — used in HTTPS, TLS, and most secure protocols — is to use asymmetric encryption once to agree on a session key, then switch to symmetric encryption for all subsequent communication.
Master encryption concepts and network security with Professor Turing's step-by-step GCSE tutoring at aitutors.me.