Used for: Text files, executable programs, spreadsheets, PNG images — any file where every bit must be preserved.
Run-Length Encoding (RLE)
RLE replaces consecutive repeated values with a count and the value:
Original: AAABBBBBCCDDDDDD → RLE: 3A5B2C6D
RLE works well for images with large areas of the same colour (e.g. simple graphics), but poorly for complex photographic images.
Huffman Encoding
Huffman encoding assigns shorter binary codes to more frequently occurring characters and longer codes to rare characters. This reduces the average number of bits per character without losing data.
Lossy Compression
Lossy compression achieves greater compression by permanently discarding some data — data considered least important or least perceptible to humans. The original file cannot be perfectly reconstructed.
Encryption is the process of transforming data (plaintext) into an unreadable form (ciphertext) using an encryption key and algorithm. Only an authorised recipient with the correct decryption key can read the original data.
Key Terms
Plaintext: The original, readable data before encryption
Ciphertext: The encrypted, unreadable output
Encryption key: A piece of data (number) used by the algorithm to encrypt/decrypt
Algorithm: The mathematical process used to transform plaintext to ciphertext
Symmetric Encryption
The same key is used for both encryption and decryption. The key must be shared securely between sender and recipient.
Example: AES (Advanced Encryption Standard)
Advantage: Fast, efficient for large data
Disadvantage: Key distribution problem — the key must be sent securely
Asymmetric Encryption (Public Key Cryptography)
Uses a public key (for encryption, shared with everyone) and a private key (for decryption, kept secret). Data encrypted with the public key can only be decrypted with the corresponding private key.
Example: RSA
Advantage: No key distribution problem — public key can be shared openly
Disadvantage: Slower than symmetric encryption
Why Encryption Matters
Protects data in transit (e.g. HTTPS, email)
Protects stored data (e.g. database encryption)
Ensures only authorised parties can read sensitive information
Exam tip: Cambridge questions distinguish carefully between lossless (original recoverable, e.g. RLE, Huffman) and lossy (data lost, e.g. JPEG, MP3). For encryption: know the difference between plaintext/ciphertext, symmetric/asymmetric, and the advantage of asymmetric (no key sharing problem). Be able to give specific examples of when each is appropriate.
⚠️ Common Mistakes
Confusing lossless with lossy — lossless means NO data is lost
Saying RLE works well for photographs — it does not; it works for simple images with repeated colours
Confusing encryption (making data unreadable) with compression (reducing file size)
Saying symmetric encryption uses two keys — it uses one shared key
Not knowing that lossy compression degrades quality on repeated use
✅ Notes completed!
▶
Video coming soon
Click slide or press arrow keys to navigate
Worksheet — 1.1.7 Data Compression and Encryption
8 questions · instantly marked · Cambridge 9618 standard
Q1State the difference between lossless and lossy compression.[2]
✅ Mark scheme
Mark scheme
Lossless: the original file can be perfectly reconstructed — no data is permanently lost [1]; Lossy: some data is permanently discarded to achieve greater compression — the original cannot be perfectly reconstructed [1].
Q2Explain how Run-Length Encoding (RLE) compresses data and give an example.[3]
✅ Mark scheme
Mark scheme
RLE replaces consecutive repeated values with a count and the value [1]; this removes redundancy by encoding runs of the same value compactly [1]; Example: AAAABBBBB → 4A5B (or equivalent) [1].
Q3Explain why lossy compression is more suitable for storing a music file than a text document.[3]
✅ Mark scheme
Mark scheme
A music file can tolerate small quality losses that are imperceptible to human hearing [1]; lossy compression (e.g. MP3) achieves greater compression ratios allowing more efficient storage [1]; a text document must preserve every character exactly — any data loss would corrupt the text, making lossless compression essential for text [1].
Q4Define the terms (a) plaintext and (b) ciphertext in the context of encryption.[2]
✅ Mark scheme
Mark scheme
(a) Plaintext: the original, unencrypted readable data [1]; (b) Ciphertext: the encrypted/scrambled output that cannot be read without the decryption key [1].
Q5State two differences between symmetric and asymmetric encryption.[4]
✅ Mark scheme
Mark scheme
Any two differences (2 marks each): Symmetric uses one shared key for both encryption and decryption; asymmetric uses a pair of keys — public and private [2]; Symmetric requires the key to be securely shared between parties; asymmetric avoids the key distribution problem because the public key can be shared openly [2]; Symmetric is faster/more efficient; asymmetric is slower [2].
Q6Explain what is meant by the 'key distribution problem' in symmetric encryption and how asymmetric encryption solves it.[3]
✅ Mark scheme
Mark scheme
Symmetric encryption requires sender and receiver to share the same secret key [1]; this key must be transmitted securely — but any interception of the key allows an attacker to decrypt all messages [1]; asymmetric encryption solves this: the public key can be shared openly without risk — only the private key (kept secret) can decrypt messages encrypted with the public key [1].
Q7Give one situation where lossless compression is essential and one where lossy compression is acceptable. Justify each choice.[4]
✅ Mark scheme
Mark scheme
Lossless essential: e.g. executable programs / text files / medical images — because every bit must be exactly preserved [1+1]; Lossy acceptable: e.g. music streaming / photographs on social media — because small imperceptible quality losses are acceptable and the higher compression saves bandwidth/storage [1+1].
Q8Explain one advantage of Huffman encoding over a fixed-length encoding scheme for compressing text data.[2]
✅ Mark scheme
Mark scheme
Huffman assigns shorter codes to more frequent characters [1]; this reduces the average number of bits per character, producing a smaller file than fixed-length encoding for typical text data [1].
Topic Quiz
Question 1 of 15
You scored
out of 15
Card 1 of 10
Click to reveal definition
🎉
All cards reviewed!
Term
Definition
🎯
Mini Test — 1.1.7 Compression & Encryption
10 questions · 10 marks · 10 minutes
⏱ 10:00
10 marks
Section A — Multiple Choice [5 marks]
Q1Which type of compression allows the original data to be perfectly reconstructed?
Q2JPEG images use which type of compression?
Q3In asymmetric encryption, what is the public key used for?
Q4Run-Length Encoding (RLE) works best on:
Q5Which statement about lossy compression is correct?
Section B — Short Answer [5 marks]
Q6State two reasons why data is compressed before being transmitted over a network.
Mark schemeAny two: Reduces transmission time [1]; reduces bandwidth requirements [1]; reduces storage space [1]; reduces cost of transmission [1].
Q7Define 'encryption' and state its purpose.
Mark schemeEncryption is the process of transforming readable data (plaintext) into an unreadable form (ciphertext) using an algorithm and key [1]; purpose: to prevent unauthorised parties from reading sensitive data [1].
Q8State one advantage of symmetric encryption over asymmetric encryption.
Mark schemeSymmetric encryption is faster / more computationally efficient than asymmetric encryption [1 mark].
Q9An image AAAAABBBBCC is represented using RLE. Write the RLE encoding.
Mark scheme5A4B2C [1 mark]. Accept any equivalent valid notation for run-length encoding.
Q10State one disadvantage of using lossy compression on an image file that will be edited multiple times.
Mark schemeEach time the image is saved with lossy compression, more data is permanently lost [1]; the quality degrades progressively with each save [1]. [1 mark for either point].