Encryption, Encryption Protocols and Digital Certificates

Computer Science A2 · Security. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Computer Science A2 topics

The idea

Encryption turns readable plain text into unreadable cipher text with an algorithm and a key. Only someone with the right key can turn it back.

In symmetric cryptography the same secret key encrypts and decrypts, so the key must reach the other person safely. In asymmetric cryptography each person has a matching pair of keys: a public key that anyone may know and a private key that is never shared. What one key encrypts, only the other key of the pair can decrypt.

The same pair of keys also proves who sent a message. This is the basis of digital signatures, digital certificates and SSL/TLS, the protocol that protects data between a browser and a web server.

In simpler words

Encryption turns readable text into a secret code using a key. Only someone with the right key can read it. In symmetric encryption both people use the same key. In asymmetric encryption each person has two keys: a public key everyone can see and a private key kept secret. What one key locks, only the other key opens. This also proves who sent a message.

An everyday comparison

A public key is like a padlock you hand out to anyone. People snap it shut on a box, but only your private key opens it. To prove a note is from you, you lock it with your private key, and anyone with your padlock key can check it. The comparison stops working because real keys are numbers in a maths process, not objects that can be copied by hand.

Rules to remember

Common mistake

Students mix up which key is used. To keep a message secret, use the receiver's public key. To prove who sent it, use the sender's private key. A private key is never sent to anyone.

In the exam

State which key is used and why. For a secret message: the sender encrypts with the receiver's public key and only the receiver's private key can decrypt it. For a digital signature: hash the message to give a digest, encrypt the digest with the sender's private key, then the receiver decrypts it and compares digests. For a certificate, list what it holds and say a CA issues it. For SSL/TLS, describe the steps in order, ending with symmetric encryption for the data.

Worked example

Sana must send Omar a report that only Omar can read, and Omar must be sure it came from Sana. Which keys does Sana use?

  1. Secrecy: only Omar may read it, so it must need a key that only Omar has, his private key. Sana therefore encrypts the report with Omar's public key.
  2. Proof of sender: the signature must need a key that only Sana has. Sana hashes the report and encrypts the digest with her own private key.
  3. Omar decrypts the report with his private key, decrypts the signature with Sana's public key, and compares that digest with his own hash of the report.

Answer: Omar's public key to encrypt the report, and Sana's private key to make the digital signature.

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← Translation SoftwareArtificial Intelligence (AI) →Take a Computer Science A2 test