Skip to topic
    ← Back to course topics

    Encryption — AQA A-Level Computer Science

    Encryption is the mathematical transformation of plaintext into unreadable ciphertext to secure data transmission and storage across networks. For AQA A-Level Computer Science, students must master symmetric and asymmetric cryptography, digital signatures, hashing algorithms, and the mathematically unbreakable Vernam cipher.

    Encryption explained

    Encryption is the process of transforming readable data, called plaintext, into an unreadable form called ciphertext, using an algorithm and a key so that only authorised parties can recover the original data.

    Read the full explanation

    The purpose is to protect the confidentiality of data, whether it is stored on a device or sent across a network. To define encryption, a learner should state that it converts plaintext into ciphertext using a key, and that decryption reverses the process using the appropriate key to restore the plaintext. Encryption does not by itself guarantee integrity or authentication, although it can support them. Understanding the definition means recognising the three elements: the input plaintext, the transformation via an algorithm and key, and the output ciphertext. A useful check is whether an answer explains both the purpose of protecting data and the role of the key.

    Your focus

    1. Understand what is meant by encryption and be able to define it.

    Which command word is this?

    Set out the mathematical or procedural stages clearly with causes and effects; e.g., explain how Bob decrypts a digital signature using Alice's public key.

    Encryption exam tips

    Topic Overview

    Encryption is the computational process of encoding messages or information in such a way that only authorized parties can access it, transforming intelligible plaintext into unintelligible ciphertext. Within AQA A-Level Computer Science, this unit covers the foundational principles of cryptographic security, distinguishing between classical algorithmic approaches and modern mathematical techniques used in distributed networks.

    Understanding encryption bridges theoretical computation with practical network security, exploring how public-key infrastructure, digital certificates, and hashing uphold the CIA triad (Confidentiality, Integrity, and Availability). Mastery of this topic requires students to evaluate symmetric versus asymmetric systems, execute bitwise XOR operations, and articulate how trust is established across untrusted channels like the Internet.

    Key Concepts
    • →Symmetric Encryption: Utilizes a single shared secret key for both encryption and decryption (e.g., AES), presenting a key distribution vulnerability.
    • →Asymmetric Encryption: Uses a mathematically linked key pair (public key for encryption/verification, private key for decryption/signing) eliminating the key exchange issue.
    • →Vernam Cipher & One-Time Pad: The only mathematically unbreakable cipher, relying on bitwise XOR with a truly random, non-repeating key equal in length to the plaintext.
    • →Hashing & Digital Signatures: One-way cryptographic functions that generate a fixed-size digest used alongside private key encryption to verify message authenticity and data integrity.
    • →Digital Certificates: Structured documents signed by a Certificate Authority (CA) that bind an entity's identity to their public key.
    Marking Points
    • Defines encryption as converting plaintext into ciphertext
    • Identifies that an algorithm and a key are used in the transformation
    • States that the purpose is to keep data confidential from unauthorised parties
    • Explains that decryption reverses the process using the correct key to recover plaintext
    Examiner Tips
    • 💡Give a definition that names plaintext, ciphertext, algorithm and key
    • 💡Include the purpose of confidentiality in your definition
    • 💡Mention that decryption reverses encryption when the question asks for a full definition
    • 💡When explaining digital certificates, always mention the role of the Certificate Authority (CA) and specify that the CA encrypts the digital certificate with the CA's own private key.
    • 💡In Vernam cipher calculation questions, always show the truth table logic or column-by-column XOR alignment; showing intermediate workings prevents losing method marks if a single bit error occurs.
    • 💡Be precise with key terminology: avoid vague phrases like 'Alice uses her key'; write 'Alice uses Bob's public key to encrypt the message' or 'Alice uses her own private key to sign the hash'.
    Common Mistakes
    • Describes encryption as compressing data; correct by stating it transforms data to protect confidentiality, not to reduce its size
    • Says encryption makes data unchangeable; correct by noting it protects confidentiality and does not by itself prevent alteration
    • Omits the role of the key in the definition; correct by stating that a key is needed for both encryption and decryption
    • Assuming asymmetric encryption is preferred for all data transfers: In reality, asymmetric encryption is computationally slow and resource-heavy, so modern protocols (like TLS) use hybrid encryption where asymmetric ciphers merely exchange a fast symmetric session key.
    • Confusing hashing with encryption: Encryption is a two-way process designed to be decrypted back to plaintext with a key, whereas cryptographic hashing is strictly a one-way deterministic mathematical function with no decrypting key.
    • Believing pseudorandom keys can make a Vernam cipher unbreakable: Computer-generated pseudorandom sequences repeat over time, creating statistical vulnerabilities that can be broken by cryptanalysis; only physical, truly random noise provides perfect secrecy.
    Revision Plan
    1. 1Week 1 (Days 1-3): Master symmetric ciphers (Caesar, substitution) and practice Vernam cipher XOR mechanics with binary and ASCII data until comfortable.
    2. 2Week 1 (Days 4-7): Contrast symmetric vs asymmetric systems; memorize the exact key sequences for confidentiality vs digital signing.
    3. 3Week 2 (Days 8-11): Study cryptographic hashing, digital signatures, and Certificate Authorities; draw flowcharts tracing data packets and cryptographic transformations across TLS/HTTPS.
    4. 4Week 2 (Days 12-14): Work through past paper exam questions under timed conditions, focusing on 6-mark and 9-mark evaluation and comparison questions.
    Exam Question Types
    • 📋Binary calculation questions: Calculating bitwise XOR for Vernam cipher encryption and decryption using ASCII character codes.
    • 📋Step-by-step procedural questions: Explaining how asymmetric encryption and digital signatures authenticate users or securely transmit symmetric session keys.
    • 📋Comparative essay questions: Evaluating the security, computational overhead, and key distribution challenges of symmetric versus asymmetric encryption.
    Command Word Expectations (AQA)
    Explain

    Set out the mathematical or procedural stages clearly with causes and effects; e.g., explain how Bob decrypts a digital signature using Alice's public key.

    Compare

    Identify specific similarities and differences between two concepts (such as symmetric and asymmetric encryption), addressing both criteria across performance, key management, and practical application.

    Show

    Provide structured mathematical or logical working step-by-step to arrive at a specified result, such as carrying out bitwise XOR operations on binary strings.

    How Students Lose Marks (Examiner Pitfalls)
    Pitfall: Confusing the operational roles of public and private keys when creating digital signatures versus performing confidential data encryption.
    ❌ Weak Answer (Loses Marks):The sender encrypts the message with their private key so nobody else can read it, and the receiver uses the public key to decrypt it.
    Example improved answer:For confidentiality, the sender encrypts plaintext using the recipient's public key, ensuring only the recipient can decrypt it with their corresponding private key. In contrast, for non-repudiation and integrity via a digital signature, the sender hashes the message and encrypts the digest with their own private key, allowing anyone with the sender's public key to verify authenticity.
    Examiner Tip: Always state whose key is used (sender vs recipient) and specify key type (public vs private), explicitly linking them to the security goal: confidentiality or authenticity.
    Pitfall: Asserting that a Caesar cipher or any cipher with a repeating key can achieve perfect secrecy like a Vernam cipher.
    ❌ Weak Answer (Loses Marks):The Vernam cipher is secure because it uses an XOR operation which cannot be reversed without the key.
    Example improved answer:The Vernam cipher provides information-theoretic security (perfect secrecy) because the key is truly random, at least as long as the plaintext, and used only once (a one-time pad). This ensures the ciphertext yields no statistical correlation or frequency bias related to the plaintext. Simple XOR with a repeating key is merely a Vigenere variant vulnerable to frequency analysis.
    Examiner Tip: To earn full marks on Vernam cipher questions, explicitly state all three conditions: truly random key, key length equal to or greater than plaintext, and used only once.
    Step-by-Step Worked Solutions

    Question: Plaintext character 'K' has the 7-bit ASCII bit pattern 1001011. It is encrypted using a Vernam cipher with the one-time pad key bit pattern 0111101. Show the bitwise XOR operation used to generate the ciphertext, and demonstrate how the recipient decrypts the ciphertext back to the original plaintext.

    1. 1.Step 1: Align the 7-bit plaintext and key bit patterns vertically to perform bitwise XOR (where 1 XOR 0 = 1, 0 XOR 1 = 1, 1 XOR 1 = 0, and 0 XOR 0 = 0): Plaintext: 1 0 0 1 0 1 1 Key: 0 1 1 1 1 0 1
    2. 2.Step 2: Calculate the XOR result column by column: Bit 6: 1 XOR 0 = 1 Bit 5: 0 XOR 1 = 1 Bit 4: 0 XOR 1 = 1 Bit 3: 1 XOR 1 = 0 Bit 2: 0 XOR 1 = 1 Bit 1: 1 XOR 0 = 1 Bit 0: 1 XOR 1 = 0 Ciphertext generated = 1110110
    3. 3.Step 3: Demonstrate decryption by applying the identical bitwise XOR operation between the ciphertext and the one-time pad key: Ciphertext: 1 1 1 0 1 1 0 Key: 0 1 1 1 1 0 1 Decrypted: 1 0 0 1 0 1 1
    4. 4.Step 4: Confirm that the decrypted bit sequence matches the original 7-bit ASCII representation of 'K' (1001011).
    Final Answer: Ciphertext bit pattern is 1110110. Applying XOR with key 0111101 successfully recovers original plaintext 1001011 ('K').

    Question: Explain the process of how Alice securely transmits a confidential document to Bob across the Internet using hybrid asymmetric and symmetric encryption, including verification of Alice's identity via a digital signature.

    1. 1.Step 1: Alice generates a cryptographic hash digest of the document using an algorithm such as SHA-256.
    2. 2.Step 2: Alice encrypts this hash digest using her own private key to generate the digital signature, ensuring authenticity and non-repudiation.
    3. 3.Step 3: Alice generates a random, temporary symmetric session key (e.g., for AES) and encrypts both the document and the digital signature using this session key for fast, computationally efficient bulk encryption.
    4. 4.Step 4: Alice encrypts the symmetric session key using Bob's public key and transmits the encrypted document, digital signature, and encrypted session key to Bob.
    5. 5.Step 5: Bob decrypts the symmetric session key using his own private key, then uses that session key to decrypt the document and digital signature.
    6. 6.Step 6: Bob decrypts the digital signature using Alice's public key to reveal Alice's original hash digest. He then hashes the received document independently and compares the two digests; identical digests verify integrity and authenticity.
    Final Answer: Alice signs the hash with her private key, encrypts payload with a symmetric session key, and encrypts the session key with Bob's public key; Bob reverses this sequence to establish confidentiality, integrity, and authenticity.
    Active Recall Memory Test
    What three strict criteria must a key satisfy for a Vernam cipher to offer mathematically perfect secrecy?
    Key Fact: The key must be truly random, at least as long as the plaintext message, and used only once (one-time pad).
    Which key does a recipient use to decrypt a confidential message encrypted with asymmetric cryptography?
    Key Fact: The recipient's own private key.
    What mathematical operation makes the Vernam cipher computationally reversible during decryption?
    Key Fact: Bitwise XOR (Exclusive OR), because (A XOR B) XOR B = A.
    Why can a hash function not be used on its own to encrypt confidential data?
    Key Fact: Hashing is a one-way irreversible function; data cannot be decrypted from a hash digest back into plaintext.
    Frequently Asked Questions
    Why is the Vernam cipher not used for all Internet traffic if it is unbreakable?
    While theoretically perfect, the Vernam cipher is practically impossible to deploy at Internet scale due to the key distribution problem. The key must be completely random, as long as the message itself, and never reused. Securely transferring gigabytes of one-time pad keys to every user prior to communication defeats the purpose of network data transmission.
    What is the difference between a private key and a secret key?
    In Computer Science terminology, a 'secret key' refers specifically to the single shared key in symmetric encryption, which must be kept secret by both communicating parties. A 'private key' refers strictly to the non-shared half of an asymmetric key pair, kept confidential exclusively by its individual owner and never transmitted.
    How do digital certificates prevent Man-in-the-Middle (MITM) attacks?
    A digital certificate binds an organization's public key to their verified identity, cryptographically signed by a trusted third-party Certificate Authority (CA). If an attacker intercepts the connection and attempts to substitute their own public key, the browser detects that the digital signature on the certificate is invalid or does not match the trusted CA root store, terminating the connection.
    What is hybrid encryption and why do modern protocols use it?
    Hybrid encryption combines asymmetric and symmetric cryptography, used in protocols like TLS/HTTPS. Asymmetric encryption is used first to securely authenticate parties and exchange a freshly generated symmetric session key. Once shared, fast symmetric encryption (such as AES) handles the bulk data transmission, combining the security benefits of public-key distribution with the computational speed of symmetric ciphers.