GCSE · Computer Science · OCR · Spec J277

Encryption (security context)

Your chats, bank and cloud files are scrambled so strangers can't read them. One of the earliest ciphers fits in your head, which is exactly why it isn't safe now.

Encryption · Caesar cipher

Watch SECRET turn into nonsense, then come back

One rule, one key, one letter at a time. Step through and keep an eye on the key column.

Before each Next, count three letters along the alphabet yourself. Did you beat the table?

1 key ← +3
2 plaintext ← "SECRET"
3 for each letter in plaintext
4 move it key places along the alphabet
5 add the new letter to the ciphertext
6 for each letter in ciphertext
7 move it key places back along the alphabet
8 add the new letter to the plaintext
stageinkeyoutresult so far
set upSECRET+3——

Output

 

Step 1: SECRET is the plaintext: the readable original. The key, +3, says exactly how far each letter moves. The rule in the code is the algorithm.

1 / 13

Step through the trace. Every letter in the table is the lesson's own working, not run by the page.

Step 1 of 13: SECRET is the plaintext: the readable original. The key, +3, says exactly how far each letter moves. The rule in the code is the algorithm..

Watch out: Encrypting moves each letter forward by the key. Decrypting moves it back by the same amount. Go forward again and you've just scrambled it a second time.

One key or two?

Symmetric encryptionvsAsymmetric encryption

Read across each row. The difference that matters most is at the top.

Focus

How many keys?

Symmetric encryption

One single secret key.

Asymmetric encryption

A pair of related but different keys: a public key and a private key.

The insight

This is the whole difference. Count the keys and you know which kind you're looking at.

What encrypts?

Symmetric encryption

The secret key.

Asymmetric encryption

The public key. Anyone can use it to encrypt data meant for the owner of the key pair.

What decrypts?

Symmetric encryption

The same secret key.

Asymmetric encryption

The private key that belongs with that public key.

Who holds which key?

Symmetric encryption

Sender and receiver must both know the same key.

Asymmetric encryption

The public key is shared freely. The owner keeps the private key secret.

The big challenge

Symmetric encryption

Distributing and managing that secret key securely, so it reaches the other person without anyone else getting it.

Asymmetric encryption

Only the private key has to stay secret, and its owner keeps it.

Asymmetric encryption · Which key?

Who can open Sam's message?

Sam owns a public and private key pair. Jess wants to send Sam a private message, so she encrypts it with Sam's public key and sends it.

Which key decrypts Jess's message? Pick the one closest to what you think right now.
How sure are you?

Encryption in real life

Where does each one belong?

Pick a description, then pick the service it describes.

Still to sort

Messaging apps (0)

End-to-end encryption between the people chatting.

Where the line is: Here even the company running the service can't read what's sent. That's what separates it from a website's secure connection.

Websites (0)

A secure, private connection between your browser and the web server.

Where the line is: It's about the link between your browser and the server, and you can see it in the address bar.

Online banking (0)

Multiple levels of encryption for sensitive financial data.

Where the line is: The give-away is more than one layer, so one broken layer isn't enough.

Cloud storage (0)

Files protected while stored online and while being uploaded.

Where the line is: It's about your files themselves, both sitting online and on the way up.

8 of 8 still to sort.

Encryption is a security measure that protects information from being read or tampered with by others. Four everyday services each use it in their own way.

Encryption · How safe is it?

Is encrypted data completely safe?

The claim

Once data is encrypted, it is completely safe.

Place each piece of evidence to load the balance. Mark the strong ones — they count double.

  1. Without the key, scrambled data is extremely difficult to decrypt.

    Evidence 1: does it support or challenge the claim?
  2. Encrypting with a key means only someone with the correct key can decode and understand the original information.

    Evidence 2: does it support or challenge the claim?
  3. Substitution ciphers, like the Caesar cipher, can be cracked by computers very quickly.

    Evidence 3: does it support or challenge the claim?
  4. If an encryption key is weak, attackers can still access the encrypted data.

    Evidence 4: does it support or challenge the claim?
  5. If an encryption key is stolen, attackers can use it to get at the data.

    Evidence 5: does it support or challenge the claim?
  6. If keys are mismanaged, encrypted data can still end up being accessed by attackers.

    Evidence 6: does it support or challenge the claim?

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Scramble it with a key, unscramble it with the right key, and know where it can still go wrong.

What you need to know

  • Encryption scrambles data so only the intended recipient can understand it, protecting it from being read or tampered with.
  • Plaintext is the readable original. Ciphertext is the scrambled version: random-looking letters, numbers or symbols.
  • An encryption algorithm is the set of rules that turns plaintext into ciphertext; a cipher is a method to encrypt and decrypt.
  • The key holds how the data was scrambled and how to unscramble it; without it, decrypting is extremely difficult.
  • Have a goA spy steals the rule 'shift every letter along the alphabet', but not how far to shift. Which piece is the spy still missing?

    The key: how far each letter was shifted.

    The rule is the algorithm. The key is what says exactly how the data was transformed and how to reverse it, so the rule alone doesn't unlock the message.

  • Decryption turns ciphertext back into readable plaintext so the intended recipient can access it.
  • In a Caesar cipher, a substitution cipher, each letter is swapped for one a fixed number of places along. Caesar's key was +3.
  • Have a goUse a substitution shift of +2 to encrypt the word BAD.

    DCF

    Each letter moves two places along: B to D, A to C, D to F. Moving two places back instead would be decrypting, not encrypting.

  • Computers can crack substitution ciphers very quickly, so today they're a very weak form of encryption.
  • Symmetric encryption uses one secret key to encrypt and decrypt; sender and receiver both need it, so sharing it securely is hard.
  • Have a goAli sends Ben their shared secret key in an ordinary, unencrypted message, then sends the encrypted homework. 'Totally safe,' says Ali. What's the flaw?

    Anyone who grabs that key can decrypt the homework too.

    With symmetric encryption the same key decrypts, so the hard part is getting the key to Ben securely. Sending it openly gives the secret away.

  • Asymmetric encryption uses a key pair: anyone can encrypt with the public key, but only the owner's secret private key decrypts.
  • Encryption greatly improves security but isn't foolproof: weak, stolen or mismanaged keys can still let attackers in.

The big picture

Encryption scrambles readable plaintext into unreadable ciphertext using an algorithm and a key, and decryption turns it back. The Caesar cipher shifts every letter a fixed number of places, but computers crack substitution ciphers like it very quickly. Symmetric encryption shares one secret key; asymmetric encryption uses a public key to encrypt and a private key to decrypt. Messaging apps, websites, online banking and cloud storage all rely on encryption, which greatly improves security but isn't foolproof.

Key points

1Plaintext + algorithm + key gives ciphertext; decryption uses the key to get the plaintext back.
2The Caesar cipher is one of the simplest and earliest known methods of encryption, and computers break ciphers like it in moments.
3Symmetric means one shared secret key; asymmetric means a public key to encrypt and a private key to decrypt.
4Messaging apps, websites, online banking and cloud storage all rely on encryption to protect data.
5Encryption is a big security win, not a guarantee: the keys have to be strong and looked after.

Worked example

Problem

A friend sends you the message JQOG. They tell you they used a Caesar-style substitution with a key of +2. Label the plaintext, ciphertext and key, then decrypt the message.

⚠ Watch out

Thinking the public key is secret, or that it can decrypt a message. The public key is shared freely so anyone can encrypt data for its owner; only the owner's private key, which is kept secret, can decrypt it.

🧠

Memory hook

A becomes D: one of the earliest ciphers, and the reason modern encryption had to move on. For key pairs, think 'post it public, keep it private': anyone can lock with the public key, only the private key opens.

✓

Check yourself

Explain, without looking, why a website can hand its public key to anyone without its visitors' data becoming readable. Then name two things that could still let an attacker in.

Flashcards

(16)
What is encryption?
Converting data into an unreadable format so it can't be understood by anyone except the intended recipient.
What is plaintext?
The original, readable version of a message or data before it has been encrypted.
What is ciphertext?
The scrambled, unreadable version of data after encryption. It looks like random letters, numbers or symbols until it is decrypted.
What does an encryption algorithm do?
It is a set of rules that transforms readable plaintext into unreadable ciphertext.
What is decryption?
Converting ciphertext back into readable plaintext so the intended recipient can access the data.
What information does an encryption key contain?
How the data was transformed into an unreadable format, and how it can be transformed back into its original, readable format.
What is a cipher?
A method or algorithm used to encrypt and decrypt information.
What is a substitution cipher?
A cipher where each letter in the original message is replaced by another letter.
What key did Caesar use, and what did A become?
A key of +3, so A became D.
Why are substitution ciphers a very weak form of encryption today?
Computers can crack them very quickly, so they are easily broken.
How many keys does symmetric encryption use, and who must know it?
One single secret key, used to encrypt and decrypt. Both the sender and the receiver must know it.
What is the big challenge with symmetric encryption?
Making sure the secret key is distributed and managed securely.
In asymmetric encryption, what is the public key for?
It is freely distributed, and anyone can use it to encrypt data meant for the owner of the key pair.
In asymmetric encryption, what is the private key for?
It is kept secret by its owner and is needed to decrypt data encrypted with the matching public key.
What does end-to-end encryption in a messaging app mean?
Even the app company can't read the messages; only the sender and the person they're messaging have the private key needed to read them.
How can you tell a website is using encryption?
The URL begins with https and a padlock icon appears in the browser address bar.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More OCR GCSE Computer Science topics

See the full OCR Computer Science curriculum →

How this lesson was checked. This OCR GCSE Computer Science (specification J277)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 3 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.