Compression, Encryption and HashingOCR A-Level Computer Science Revision

    This topic covers the fundamental techniques used for data management and security in computer systems. It explores the principles of data compression, the

    Topic Synopsis

    This topic covers the fundamental techniques used for data management and security in computer systems. It explores the principles of data compression, the mechanisms of symmetric and asymmetric encryption, and the role of hashing in data integrity.

    Key Concepts & Core Principles

    Exam Tips & Revision Strategies

    Common Misconceptions & Mistakes to Avoid

    Examiner Marking Points

    Compression, Encryption and Hashing

    OCR
    A-Level

    This topic covers the fundamental techniques used for data management and security in computer systems. It explores the principles of data compression, the mechanisms of symmetric and asymmetric encryption, and the role of hashing in data integrity.

    0
    Objectives
    3
    Exam Tips
    3
    Pitfalls
    0
    Key Terms
    5
    Mark Points

    Topic Overview

    Compression, encryption, and hashing are fundamental techniques in computer science for managing data efficiently and securely. Compression reduces file sizes for storage and transmission, encryption ensures data confidentiality by converting plaintext into ciphertext, and hashing provides data integrity by generating fixed-size digests. These concepts are essential for understanding how modern systems handle data securely and efficiently, from streaming services to secure communications.

    In the OCR A-Level specification, you need to understand both lossy and lossless compression algorithms, symmetric and asymmetric encryption, and the properties of hash functions. These topics link to broader areas like network security, data storage, and error detection. Mastery of these concepts is crucial for exam questions that ask you to compare algorithms, explain their applications, or analyse their strengths and weaknesses.

    Real-world applications include JPEG compression for images, AES encryption for secure data transmission, and SHA-256 for verifying file integrity. Understanding these techniques prepares you for further study in cybersecurity, data science, and software engineering, and is directly assessed in Paper 1 and Paper 2 of the OCR A-Level.

    Key Concepts

    Core ideas you must understand for this topic

    • Lossless vs lossy compression: Lossless (e.g., Run-Length Encoding, Huffman coding) preserves all original data, while lossy (e.g., JPEG, MP3) discards some data to achieve higher compression ratios.
    • Symmetric encryption uses the same key for encryption and decryption (e.g., AES), while asymmetric encryption uses a public/private key pair (e.g., RSA).
    • Hash functions (e.g., SHA-256) produce a fixed-size output from any input, are one-way (cannot be reversed), and are collision-resistant (two different inputs should not produce the same hash).
    • Encryption ensures confidentiality; hashing ensures integrity and authenticity (e.g., password storage, digital signatures).
    • Compression ratio = original size / compressed size; higher ratio means more compression.

    What You Need to Demonstrate

    Key skills and knowledge for this topic

    • Distinction between lossy and lossless compression
    • Application of run length encoding
    • Application of dictionary coding
    • Understanding of symmetric encryption
    • Understanding of asymmetric encryption

    Marking Points

    Key points examiners look for in your answers

    • Distinction between lossy and lossless compression
    • Application of run length encoding
    • Application of dictionary coding
    • Understanding of symmetric encryption
    • Understanding of asymmetric encryption

    Examiner Tips

    Expert advice for maximising your marks

    • 💡Ensure you can clearly define the difference between lossy and lossless compression
    • 💡Be prepared to perform run length encoding on a given string of data
    • 💡Understand the key difference between symmetric and asymmetric encryption regarding the use of keys
    • 💡When comparing compression algorithms, always mention the trade-off between file size and quality (lossy) or computational overhead (lossless). Use specific examples like ZIP vs JPEG.
    • 💡For encryption questions, clearly distinguish between symmetric and asymmetric, and state which is faster (symmetric) and which solves key distribution (asymmetric).
    • 💡In hashing questions, emphasise properties: deterministic, fast to compute, preimage resistant, collision resistant. Use real-world examples like password hashing (with salt) or file integrity checks.

    Common Mistakes

    Pitfalls to avoid in your exam answers

    • Confusing the mechanisms of symmetric and asymmetric encryption
    • Failing to explain the difference between lossy and lossless compression in terms of data recovery
    • Misapplying run length encoding to data that does not contain repeated sequences
    • Misconception: Encryption and hashing are the same. Correction: Encryption is reversible (with the key), while hashing is one-way and cannot be decrypted.
    • Misconception: Lossy compression always results in noticeable quality loss. Correction: Modern lossy algorithms (e.g., JPEG at high quality) can be nearly indistinguishable from the original while significantly reducing file size.
    • Misconception: A hash can be used to encrypt data. Correction: Hashes are not encryption; they are used for verification, not confidentiality.

    Frequently Asked Questions

    Common questions students ask about this topic

    Before You Start

    Prior knowledge that will help with this topic

    • Basic understanding of binary representation and data storage (bits, bytes).
    • Familiarity with algorithms and data structures (e.g., trees for Huffman coding).
    • Fundamentals of computer networks and security (e.g., why encryption is needed).

    Likely Command Words

    How questions on this topic are typically asked

    Describe
    Explain
    Compare
    Apply

    Ready to test yourself?

    Practice questions tailored to this topic