top of page

Exam Board:
OCR A-Level

3.1 - Compression, Encryption and Hashing

Specification:
Computer Science H446

Watch on YouTube:
Lossy & Lossless Compression
Lossless Compression Algorithms
Encryption
Hashing

Lossy vs Lossless Compression

This page is under active development. Check here for more information.

noun-under-construction-7744129e.png
noun-compression-8010678e.png

Compression is the process of reducing the size of a file so it takes up less storage space and can be transmitted more quickly over a network. It works by encoding data more efficiently or removing unnecessary information. The main benefits of compression include faster file transfer speeds, reduced storage requirements and improved performance when streaming data.

​

  • Lossy compression permanently removes some data that is less important to human perception, such as subtle sounds or image details, resulting in smaller file sizes but slightly lower quality.

​​​

  • Lossless compression reduces file size without losing any data, allowing the original file to be perfectly restored after it is decompressed.

Lossless Compression Algorithms

noun-dictionary-4218354e.png

There are two types of lossless compression that you need to know:

​

  • Run-Length Encoding (RLE) is a simple form of lossless compression that reduces file size by storing repeating data as a single value and a count. For example, a sequence like AAAAABBBCCCC could be stored as A5B3C4, saving space in files with many repeated elements, such as pixels in images.

​

  • Dictionary Encoding replaces repeating patterns of data with shorter codes that reference entries in a dictionary. The dictionary stores common sequences once, and each repetition is replaced by a shorter reference, making it efficient for text and other data with recurring patterns.

Encryption

Encryption is the process of converting readable data (plaintext) into an unreadable form (ciphertext) to prevent unauthorised access. It ensures the confidentiality and security of information during storage or transmission. There are two key types of encryption:

​

  • Symmetric encryption uses the same key for both encryption and decryption, meaning the sender and receiver must share the key securely. It is fast and efficient, making it suitable for encrypting large amounts of data. However, key distribution is a major risk if the key is intercepted.

​

  • Asymmetric encryption uses a pair of keys - a public key for encryption and a private key for decryption. It is more secure for communication but slower due to complex mathematical processes. Asymmetric encryption is often used to exchange symmetric keys securely before data transfer.

noun-encryption-7968011e.png

Hashing

Hashing is the process of applying a mathematical function (hash function) to data to produce a fixed-size value, known as a hash. It is a one-way process, meaning the original data cannot be reconstructed from the hash.

​

Hashing is commonly used for data integrity checks, password storage and digital signatures. Even a tiny change in the input data produces a completely different hash, making it useful for detecting tampering or corruption.

noun-hashing-7929403e.png
logoheadwhite.png

Questo's Key Terms

Compression: lossy compression, lossless compression, run-length encoding, dictionary encoding

​​​​

Encryption: plaintext, ciphertext, key, symmetric encryption, asymmetric encryption

​​

Hashing: hash function, hash​

Did You Know?

Alan Turing and his team used pattern recognition to analyse recurring sequences in encrypted German messages, helping to break the Enigma code, which was a major factor in the Allies’ victory in World War II.

noun-7579608e.png

3.2 - Databases

© CSNewbs 2025

The written, video and visual content of CSNewbs is protected by copyright. © 2025
bottom of page