Chapter 17 - Security

Cambridge International (9618) Computer Science - 2024/2025 Syllabus

Notes by @siby by Sachintha Senanayake is licensed under CC BY-NC-SA 4.0Creative CommonsAttributionNonCommercialShareAlike

17.1 - Show understanding of how encryption works

Encryption

Terminology

Symmetric Key Cryptography

a2-theory-security-1
Figure 17.1 - Symmetric Key Encryption Process
a2-theory-security-2
Figure 17.2 - Key Derivation Function - Simplified Process
  1. The sender and receiver generate their secret key; independently of each other.
  2. They use a modulo function F(X) to generate respective remainder values.
  3. The sender and receiver exchange their remainder values RS and RR.
  4. They use the same modulo function, but substitute the bases with the exchanged remainders (we will call this function G(X)) to generate a final secret key - which should be the same for both the receiver and sender.

Asymmetric Key Cryptography

a2-theory-security-3
Figure 17.3 - Asymmetric Key Encryption Process
  1. The receiver (R) generates its own public and private key pair using a key generator algorithm. The receiver will transmit just its public key across the internet to the sender before the transmission begins.
  2. When the sender wants to send a message to the receiver, it will use the receiver's public key (KRpublic) to encrypt the plaintext into ciphertext.
  3. This ciphertext is then transmitted across the internet to the receiver.
  4. The receiver will use its private key (KRprivate) to decrypt the message back into plaintext.
a2-theory-security-4
Figure 17.4 - Asymmetric Key Encryption w/ Sender Verification
  1. The receiver (R) and the sender (S) share their public keys with each other - across the internet - before transmission begins.
  2. Unlike earlier, the sender will first encrypt the data using its private key (KSprivate) to produce an initial cipher text C1.
  3. This is passed through another round of encryption but now using the receiver's public key (KRpublic) to produce the final cipher text C2.
  4. This ciphertext C2 is transmitted across the internet to the receiver (R).
  5. To decrypt the received ciphertext, the receiver will use its private key (KRprivate) to obtain the initial cipher text C1.
  6. To obtain the original ciphertext, the receiver will use the sender's public key (KSpublic).

Quantum Cryptography

a2-theory-security-5
Figure 17.5 - Simplified BB84 QKD Scheme
  1. The sender generates unpolarized photons using a light source (L). Each photon represents a quantum bit of information.
  2. The sender selects a random sequence of polarization filters.
  3. Each unpolarized photon is passed through the respective random polarization filter. This causes the photons to be polarized perpendicular to the plane of the polarizing filter.
  4. Using a photon-bit map, the polarized photons are encoded into binary 1s and 0s.
  5. The encoded photons are transmitted across the internet via a fiber optic cable.
  6. The receiver selects a random sequence of beam splitters. There are 2 kinds of beam splitters; rectilinear and diagonal.
  7. The receiver passes the incoming polarized photons through the randomly selected sequence of beam splitters. This is referred to as observing the quantum bit:
    • When horizontally / vertically polarized photons are observed through a rectilinear splitter, the emerging photon is exactly that passed in.
    • When horizontally / vertically polarized photons are observed through a diagonal splitter, the emerging photon is maximally uncertain. This means that the emerging photon has a 50% chance of oscillating vertically, and a 50% chance of oscillating horizontally. Hence the emerging photon exists in a superposed state which collapses into 1 of the 2 oscillating planes probabilistically.
    • The same principles apply to diagonally polarized photons passing through a rectilinear / diagonal splitter.
  8. As a result of observation, those superposed photons will probabilistically collapse into one plane or the other, while the photons that passed through beam splitters that had the same plane of polarization as that of their polarizing filter are observed through unaltered.
  9. This results in a bit sequence - looked up from the same photon-bit map that may have some bits altered (i.e. see the blue color bit)
  10. To ensure that the receiver's beam splitters are in line with the sender's polarizing filters, the receiver transmits its beam splitter sequence to the sender.
  11. The sender replies with any corrections to the beam splitters by observing the bit sequence the receiver calculated with that of itself. This synchronizes the 2 parties for the duration of the communication.
Advantages of Quantum Cryptography
  1. Unbreakable security due to quantum mechanics principles.
  2. Future-proof against advances in computing power, including quantum computers.
  3. Secure key distribution through eavesdropping detection.
  4. Ability to detect any attempt at intercepting or measuring the quantum states.
Disadvantages of Quantum Cryptography
  1. Limited range (~ 250 km) for transmitting quantum signals.
  2. Complex + requires specialized and costly hardware/infrastructure (QKD filters, beam splitters, fiber optic networks).
  3. Only secures key distribution, not key management or data transmission itself.
  4. Polarization of light can change even without an eavesdropper, leading to false positives.
  5. Criminals can hide their conduct better online when quantum computing goes mainstream.

17.2 - Show awareness of the Secure Socket Layer (SSL) / Transport Layer Security (TLS)

Security Protocols

a2-theory-security-6
Figure 17.6 - A website with / without TLS encryption and a valid digital certificate

Secure Sockets Layer (SSL)

a2-theory-security-7
Figure 17.7 - TLS 1.2 Handshake Protocol
  1. Client Hello: A message sent by the client to initiate the connection. Contains details such as the protocol version, session ID (a unique identifier to help resume a previous session without performing the full handshake process again, aiding efficency), cipher suite (the cryptography algorithms supported by the client), compression method and a random number (used to generate a session key)
  2. Server Hello: A message similar to the "Client Hello" sent by the server back to the client upon receiving the "Client Hello" that confirms the final cipher suite (for example, RSA, Diffie-Hellman, etc.), compression method, etc. that will be used.
  3. Server Certificate: A digital certificate / certificates sent by the server to the client to authenticate itself. This contain's the server's public key which will be used later (referred to as the subject public key in general)
  4. Server Hello Done: A message signifying the end of the "Server Hello" and associated messages.
  5. Client Key Exchange: The client generates a key known as the pre-master key that is encrypted using the server's public key (found in the server certificate). This key is sent to the server.
    • At around the same time, the client would use the server's random number (from Server Hello), its own random number (from "Client Hello") and the recently generated pre-master key to compute the session key (aka. master key). More information about the exact algorithms used here are described in RFC6101, the IETF's original documentation of SSL v3.0.
  6. Change CipherSpec (from Client): Since the session key has now been generated, messages hereafter will be encrypted using this session key. The CipherSpec message informs the server of this change.
  7. Client Finished: A message indicating the end of handshake process on the client side. This is the first piece of data to be protected using the shared key via symmetric key cryptography.
  8. Change CipherSpec (from Server): The server first decrypts the pre-master key sent by the client in the "Client Key Exchange" stage and uses the same process to compute the session key (since the parameters used to compute this are the same, the secret key generated must be the same as that of the client). After this, a similar CipherSpec message is sent to the client to indicate that messages hereafter from the server will be encrypted with this session key.
  9. Server Finished: A message similar to that of "Client Finished" protected using the shared key. A hash is also computed to ensure the integrity of the handshake.

Transport Layer Security (TLS)

a2-theory-security-8
Figure 17.8 - TLS Layers in the TCP/IP Stack
  1. Handshake Protocol: Performs a process identical to that of SSL, with support for more secure and up-to-date cipher suites such as Advanced Encryption Standard (AES), and replaces the now outdated MD5 algorithm - for HMAC (Hash-based Message Authentication Code) - when generating message authentication codes (MACs). This provides more complex cryptography and security.
  2. Record Protocol: Responsible for the actual transmission of data after the handshake process:
    • On transmission: fragments the data into manageable blocks, optionally compresses the data, applies a MAC (message authentication code) and encrypts the result.
    • On receipt: blocks are decrypted, verified, decompressed, reassembled, and then delivered to the application layer.

17.3 - Show understanding of digital certification

Digital Signatures

Digital Certificates