Ch 3 · 17 Security · AS & A Level Computer Science 9618
Topic 3 of 3 in Hardware, System Software and Security — AS & A Level Computer Science 9618 — 79 lessons.
Introduction
Data sent across the internet can be intercepted. Encryption makes intercepted data useless, digital signatures prove who sent a message, and digital certificates prove that a public key really belongs to who it claims. These ideas come together in SSL/TLS, which secures web traffic. (Syllabus topic 17: section 17.1.)
Key ideas — 17.1 (a) Encryption terms
Encryption does not stop data being intercepted; it makes intercepted data meaningless.
🧑🏫 Teacher's explanation
Imagine you want to send a secret note to a friend in a classroom full of eavesdroppers. If you write it in English, anyone who grabs the note can read it. This is your 'plain text'. If you use a secret code where 'A' becomes 'X', 'B' becomes 'Q', and so on, the note becomes gibberish to anyone else. This gibberish is your 'cipher text'.
📖 Definitions
🔍 Worked example — Easy
A simple Caesar cipher uses a shift of k=3 as the key. Convert the plain text 'CAT' into cipher text using this algorithm.
🔍 Worked example — Standard
A message is encrypted using a symmetric key. The cipher text is C = 15 and the key is k = 7. If the encryption algorithm was C = (P + k) pmod26, find the plain text P.
🔍 Worked example — Exam-style
A hacker intercepts a data packet. The packet contains the cipher text 10110111_2. The decryption key is 1101_2. Using a simple XOR operation for decryption, find the resulting plain text in binary.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Key ideas — 17.1 (b) Symmetric key cryptography
The same secret key is used to encrypt and decrypt.
🧑🏫 Teacher's explanation
Imagine you have a physical lockbox and a single key. You put a secret note inside the box, lock it with your key, and send the box to a friend. For your friend to read the note, they must have a duplicate of that exact same key. This is the essence of symmetric cryptography.
📖 Definitions
🔍 Worked example — Easy
A simple Caesar cipher is a type of symmetric encryption. If the key is a shift of 3 and the plain text is \"CAT\", what is the resulting cipher text?
🔍 Worked example — Standard
A sender uses a symmetric key to encrypt a message. The plain text is represented by the binary string 10101011. The encryption algorithm performs a bitwise NOT operation (inverts all bits). What is the cipher text?
🔍 Worked example — Exam-style
A system uses a symmetric key to encrypt a 1 ext GB file. The encryption process takes 2 ext seconds. If the system switches to an asymmetric method that is 10 times slower, how long will it take to encrypt the same file?
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Key ideas — 17.1 (c) Asymmetric key cryptography
Each user has a pair of keys that are mathematically related:
🧑🏫 Teacher's explanation
Imagine a mailbox with two different slots. One slot is wide open and anyone can drop a letter in (the public key), but once the letter is inside, only the owner with the specific physical key can open the back to read it (the private key). This is the essence of asymmetric cryptography: anyone can 'lock' a message for you, but only you can 'unlock' it.
📖 Definitions
🔍 Worked example — Easy
A user wants to send a confidential message to Alice. Describe the steps using asymmetric encryption to ensure only Alice can read it.
🔍 Worked example — Standard
A sender wants to prove a message is authentic (not from anyone else) using asymmetric encryption. Explain the process.
🔍 Worked example — Exam-style
In a hybrid encryption system, why is asymmetric encryption used to exchange a symmetric session key instead of just using symmetric encryption for the whole session?
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Key ideas — 17.1 (d) Quantum cryptography
Quantum cryptography uses the properties of photons (particles of light) to exchange keys: quantum key distribution (QKD). Each bit of the key is sent as a photon with a particular polarisation. Measuring a photon changes its state, so any attempt to eavesdrop disturbs the photons and can be detected by the sender and receiver, who then discard the key.
🧑🏫 Teacher's explanation
Imagine you are sending a secret message written on a soap bubble. If an eavesdropper tries to grab the bubble to read the message, the bubble pops or changes shape instantly. When the recipient receives the bubble, they notice it looks different, so they know someone tried to peek.
📖 Definitions
🔍 Worked example — Easy
A QKD system detects an error rate of 15\% in the received photon stream. If the threshold for a secure key is 5\%, what is the status of the key?
🔍 Worked example — Standard
Identify the primary benefit and the primary drawback of using QKD over traditional asymmetric cryptography.
🔍 Worked example — Exam-style
A network administrator is deciding between standard RSA (asymmetric) and QKD for a high-security link. Evaluate the suitability of QKD for a trans-continental link (e.g., London to New York) using current technology.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
(a) Explain how the physical properties of photons allow a sender and receiver to detect the presence of an eavesdropper. [3] (b) State one drawback of using QKD compared to traditional encryption methods. [1] [4 marks]
Key ideas — 17.1 (e) SSL/TLS
SSL (Secure Sockets Layer) and its successor TLS (Transport Layer Security) are protocols that provide secure communication over a network.
🧑🏫 Teacher's explanation
Imagine you want to send a secret letter to a friend in a crowded classroom. If you just write it on a postcard, anyone can read it. If you put it in a box with a padlock that only your friend has the key to, it is secure. However, how do you get that padlock to your friend without someone stealing it first?
📖 Definitions
🔍 Worked example — Easy
Identify the three primary purposes of using SSL/TLS in a client-server communication session.
🔍 Worked example — Standard
A client wants to communicate securely with a server. Describe the role of the server's digital certificate during the TLS handshake.
🔍 Worked example — Exam-style
Explain why the protocol switches from asymmetric encryption to symmetric encryption after the initial handshake.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
a) State two purposes of using the TLS protocol. [2]
Key ideas — 17.1 (f) Digital certificates
A digital certificate is an electronic document that links a public key to its owner, so others can trust that the key really belongs to that person or organisation. It contains: the owner's name/organisation and domain, the owner's public key, the issuing certificate authority, a serial number, the validity dates, and the CA's own digital signature.
🧑🏫 Teacher's explanation
Imagine you want to send a secret letter to a famous author. You know their name, but how do you know the address you found online actually belongs to them and not an impostor? You look for a wax seal on the envelope from a trusted notary. That notary is like a Certificate Authority (CA). They have verified the author's identity and stamped the address with their official seal.
📖 Definitions
🔍 Worked example — Easy
Identify the four essential components that must be included in a digital certificate to ensure a user can verify the owner's identity and the certificate's validity.
🔍 Worked example — Standard
Trace the process of how a website (Server) acquires a digital certificate.
🔍 Worked example — Exam-style
A user receives a digital certificate. Explain how the user's browser uses the Certificate Authority's (CA) public key to verify the certificate's authenticity.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Key ideas — 17.1 (g) Digital signatures
A digital signature proves who sent a message (authentication) and that it was not changed (integrity).
🧑🏫 Teacher's explanation
Imagine you are sending a physical letter. To prove it really came from you, you don't just sign your name (which anyone can copy); instead, you take a unique fingerprint of the letter's contents, put that fingerprint in a tiny box, and lock it with your personal, secret key. You send the letter and the locked box together.
📖 Definitions
🔍 Worked example — Easy
A sender wants to sign a message. The message is 'HELLO'. The hashing algorithm produces a digest of H. The sender's private key is K_priv. What is the digital signature?
🔍 Worked example — Standard
A receiver receives a message M and a digital signature S. They use the sender's public key K_pub to decrypt S, resulting in digest D_1. They then hash the received message M to get D_2. If D_1 = D_2, what has been proven?
🔍 Worked example — Exam-style
A sender uses a hash function H(x) to create a digest. The message is $M = \text{"Pay \$100"}$. The signature is S. A man-in-the-middle intercepts the transmission and changes the message to $M' = \text{"Pay \$1000"}$ but leaves the signature S unchanged. Explain why the receiver will detect this.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Worked example
Alice wants to send a confidential message to her bank, and the bank wants to send a verified announcement to all its customers. State which keys are used in each case.
🔍 Worked example — Easy
Alice wants to send a private message to Bob using asymmetric encryption. She has Bob's public key. Describe the process of ensuring only Bob can read the message.
🔍 Worked example — Standard
A bank wants to send a verified announcement to its customers. Explain how the bank uses its keys to ensure customers know the message is authentic and has not been altered.
🔍 Worked example — Exam-style
Compare symmetric and asymmetric encryption in terms of key management for a network of 100 users where every user needs to communicate privately with every other user.
⚠️ Common errors
Common mistakes
Practice
Answers: (1) Plain text: the original readable data; cipher text: the encrypted, unreadable form. (2) The same secret key must be shared securely before use, and could be intercepted; with asymmetric encryption, the public key can be shared openly, because only the private key, which is never sent, can decrypt. (3) They obtain the company's public key, encrypt the message with it, and send it; only the company's private key can decrypt it. (4) Benefit: eavesdropping on the key is detected. Drawbacks, any two: expensive equipment; limited distance; low data rates; still in development. (5) The browser requests a secure connection; the server sends its digital certificate with its public key; the browser verifies the certificate with the CA; they use asymmetric encryption to agree a symmetric session key; all data is then encrypted with the session key. (6) The organisation generates a key pair, sends its public key and identity details to a CA, the CA verifies its identity, then issues a certificate containing the public key, signed with the CA's private key. (7) The receiver decrypts the signature with the sender's public key to get the digest, hashes the received message, and compares the two digests; if they match, the message is authentic and unaltered.