Encryption & Hashing (OCR A-Level CS 1.3.1)

OCR A-Level CS 1.3.1: symmetric vs asymmetric encryption and the uses of hashing, including password storage. Worked examples, diagrams and exam tips.


Free Encryption Hashing revision resources (OCR A-Level Computer Science, 1.3.1)

We’ve made exam-style practice for this exact topic, free to download: Encryption Hashing question sheet, mark scheme and cheat sheet. Grab them, have a go, then read the full guide below.

When you log in, shop online or send a message, encryption keeps it private and hashing protects your password. Spec point 1.3.1 covers symmetric and asymmetric encryption and the different uses of hashing — reliably tested on Paper 1, including a 9-mark "compare encryption and hashing" and a 9-mark "impact of encryption on society".

This guide explains the two kinds of encryption and what hashing is really for.

What is encryption?

Encryption scrambles data (plaintext) into an unreadable form (ciphertext) using a key, so that anyone intercepting it cannot understand it. Only someone with the correct key can decrypt it back to the original. Encryption protects confidentiality — it does not stop data being intercepted, only being understood.

What is the difference between symmetric and asymmetric encryption?

Symmetric encryption uses one shared key for both encrypting and decrypting. It is fast and simple, but it has a key distribution problem: the sender and receiver must both have the same secret key, and getting it to each other securely is hard — if it is intercepted, the encryption is broken.

Asymmetric encryption uses a pair of keys: a public key that anyone can use to encrypt a message, and a matching private key, kept secret by the owner, that is the only thing that can decrypt it. This solves key distribution (you can share your public key openly) and underpins HTTPS and digital signatures. It is slower, so in practice systems often use asymmetric encryption to exchange a symmetric key, then switch to fast symmetric encryption.

What is hashing?

Hashing runs data through a hash function to produce a fixed-length value (the hash or digest). Crucially, hashing is one-way: you cannot reverse a hash to get the original data. The same input always gives the same hash, but a tiny change to the input gives a very different hash.

This is different from encryption: encryption is two-way (designed to be decrypted with a key); hashing is one-way (designed never to be reversed).

What are the uses of hashing?

  • Storing passwords. Systems store the hash of a password, not the password itself. At login, the entered password is hashed and the hashes are compared. If the database is stolen, the attacker only gets hashes, not the real passwords.

  • Checking data integrity. Hash a file before and after transfer; if the hashes match, the file is unchanged.

  • Hash tables / fast lookup. A hash function maps a key to an index so data can be found quickly (linked to data structures).

What makes a good hashing algorithm?

For passwords and integrity you want it to be fast to compute but practically impossible to reverse, to produce a fixed-length output, and to have few collisions (different inputs rarely give the same hash). These are exactly the "characteristics to look for" the exam asks about.

Common exam mistakes

  • Confusing encryption and hashing. Encryption is reversible with a key; hashing is one-way and never decrypted.

  • Saying encryption stops interception. It stops data being understood, not intercepted.

  • Muddling the asymmetric keys. The public key encrypts; only the private key decrypts. Never share the private key.

  • Saying passwords are "encrypted". Good systems hash passwords so they cannot be recovered, even by the site.

  • Forgetting symmetric's weakness. Its problem is secure key distribution, which asymmetric solves.

Quick recap

  • Encryption scrambles plaintext into ciphertext using a key; only the right key decrypts it. Protects confidentiality.

  • Symmetric = one shared key (fast, but hard to distribute securely). Asymmetric = public key encrypts, private key decrypts (solves key distribution; slower; powers HTTPS).

  • Hashing is one-way: input → fixed-length hash, cannot be reversed.

  • Uses of hashing: password storage, data integrity checks, hash tables.

  • Good hash function: fast, fixed-length output, very hard to reverse, few collisions.

Frequently asked questions

What is encryption? Encryption scrambles readable data (plaintext) into unreadable ciphertext using a key. Only someone with the correct key can decrypt it back to the original, so intercepted data cannot be understood. It protects confidentiality.

What is the difference between symmetric and asymmetric encryption? Symmetric encryption uses a single shared key to both encrypt and decrypt, which is fast but hard to distribute securely. Asymmetric encryption uses a public key to encrypt and a separate private key to decrypt, which solves key distribution but is slower.

What is hashing? Hashing passes data through a hash function to produce a fixed-length value called a hash. It is one-way, so the original cannot be recovered from the hash, and the same input always produces the same hash.

What is the difference between encryption and hashing? Encryption is two-way: data is scrambled and can be decrypted with a key. Hashing is one-way: data is turned into a fixed-length hash that cannot be reversed back to the original. Encryption protects confidentiality; hashing is used for verification.

Why are passwords stored as hashes? So the actual passwords are never stored. At login the entered password is hashed and compared with the stored hash. If the database is stolen, attackers only get hashes, not the real passwords, because hashing cannot be reversed.

What makes a good hashing algorithm? It should be quick to compute but practically impossible to reverse, produce a fixed-length output, and rarely produce collisions where two different inputs give the same hash. These properties make it secure for passwords and reliable for integrity checks.

 

 

 

Logo

All trademarks, logos and brand names are the property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, trademarks and brands does not imply endorsement.


Follow us on:

Icon
Icon
Icon
Icon
Icon

Support@shuttlelearning.com

Logo

All trademarks, logos and brand names are the property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, trademarks and brands does not imply endorsement.


Follow us on:

Icon
Icon
Icon
Icon
Icon

Support@shuttlelearning.com

Logo

All trademarks, logos and brand names are the property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, trademarks and brands does not imply endorsement.


Follow us on:

Icon
Icon
Icon
Icon
Icon

Support@shuttlelearning.com