IB COMPUTER SCIENCE | A2.4.4 Encryption and Digital Certificates

Lesson objective

Describe symmetric and asymmetric cryptography, public/private key roles, digital certificates in secure connections and the significance of key management.

Learn

A2.4.4 | ENCRYPTION AND DIGITAL CERTIFICATES

01 | HIDE THE CONTENT, BUT ALSO CHECK WHO IS THERE

A student sends a private message to the school portal. They want an observer on the network to be unable to read it, but they also need confidence that the endpoint really is the intended portal. Secret content sent securely to the wrong recipient is still a problem.

Encryption transforms readable plaintext into ciphertext using an algorithm and a key. Decryption recovers the plaintext with the appropriate key and conditions. Secure communication also needs integrity and authentication, not confidentiality alone.

This lesson covers symmetric and asymmetric cryptography, the different roles of public and private keys, digital certificates and the importance of key management. It is a common SL/HL objective.

We will build the ideas in small steps before following a simplified modern TLS connection. You do not need to invent an encryption algorithm or calculate its internal mathematics for this lesson.

02 | AN ALGORITHM IS NOT THE SAME AS A KEY

A cryptographic algorithm specifies the mathematical operations. A key is a value used by the algorithm to control a particular cryptographic operation. Different keys can produce different results using the same algorithm.

A secure design does not depend on keeping the algorithm’s existence or rules secret. Well-reviewed algorithms can be public while the required secret keys remain protected. The difficult task for an attacker should be recovering protected information without the necessary secret.

Encoding is different: writing text as hexadecimal or Base64 changes representation and does not require a secret to reverse it. Hashing also differs: a cryptographic hash produces a fixed-size digest and is not an encryption method designed for decryption.

Keep these terms separate. A certificate can contain public information, a hash can support a signature process, and keys can protect messages, but none of those statements makes them the same object.

03 | SYMMETRIC ENCRYPTION: A SHARED SECRET

In symmetric encryption, the communicating parties use the same shared secret key for the encryption and decryption relationship. In a simple message example, Alice encrypts for Bob using their shared key and Bob decrypts using that secret.

This is efficient for protecting substantial amounts of data. AES is a familiar symmetric block cipher; complete secure use requires an appropriate mode or construction, not just the algorithm’s name. Authenticated encryption constructions can protect integrity as well as confidentiality.

Anyone who obtains the relevant shared secret may be able to read protected data or impersonate a holder in the relevant context. The parties therefore need a safe way to establish, store and use that secret.

A real protocol may derive separate keys for different traffic directions and purposes from shared secrets. “Symmetric” does not require one literal key to be reused forever for both directions, every file and every operation.

SENDER

Plaintext + shared secret key

Encryption produces ciphertext

NETWORK PATH

Ciphertext travels

The secret key is not simply attached in plaintext

RECEIVER

Ciphertext + appropriate shared secret key

Decryption recovers plaintext

04 | WHY SHARING THE KEY IS A REAL PROBLEM

Suppose Alice and Bob have never communicated securely before. If Alice sends a new symmetric key as an ordinary readable message, an observer who obtains it can use it too. Encrypting later messages does not repair that insecure key delivery.

Secrets can be provisioned through an already protected arrangement, or established using suitable cryptographic mechanisms. The question is not only “which cipher?” but “how do the correct parties obtain their key without giving it to the attacker?”

Sharing one secret among many people also complicates control. Anyone with it can potentially use it, and removing one person’s access may require replacing the key for the remaining authorised users. Different services and sessions often need separate key material.

This motivates public-key methods for authentication and key establishment, combined with efficient symmetric protection for ordinary traffic.

05 | ASYMMETRIC CRYPTOGRAPHY: RELATED BUT DIFFERENT KEYS

Asymmetric, or public-key, cryptography uses a mathematically related public key and private key. The public key can be distributed; the private key must be protected by its holder. Knowing the public key should not make deriving the private key computationally feasible for a secure suitable scheme.

Public-key techniques support different purposes, including encryption, digital signatures and key agreement. Not every algorithm or key is interchangeable across all those purposes. Use the operation the scheme actually supports.

For public-key encryption, the sender encrypts for the intended recipient using that recipient’s public key; the corresponding private key is needed for decryption. A suitable RSA-based encryption scheme is a familiar example.

Public-key techniques usually involve more work per operation than symmetric protection of bulk data. Systems therefore commonly combine them instead of using public-key encryption for every byte of a large transfer.

06 | WHOSE KEY DO I USE FOR CONFIDENTIALITY?

Alice wants Bob to read a message. In a suitable public-key encryption scheme, she uses Bob’s public key. Bob uses Bob’s private key to decrypt. Alice’s private key is not the key that makes a message confidential to Bob.

Anyone can obtain a public key and encrypt a message for its holder, so this operation alone does not establish that Alice authored the message. Confidentiality and sender authentication are different properties.

A further problem remains: how does Alice know that a key labelled “Bob” actually belongs to the intended Bob? An attacker could substitute another key if the distribution is not authenticated. Certificates and other trust arrangements address that binding.

Use the recipient’s perspective: the public key can be shared so senders can protect messages to the recipient, while the recipient’s private key stays secret.

07 | DIGITAL SIGNATURES: A DIFFERENT OPERATION

A digital signature uses the signer’s private key in a supported signature scheme. Others use the corresponding public key to verify the signature against the data. This can provide evidence of data integrity and use of the relevant signing key, under the scheme’s assumptions.

Alice signs with Alice’s private signing key; Bob verifies with Alice’s public verification key. This reverses the ownership focus from the confidentiality example because the goal is checking the signer, not hiding content for Bob.

A signature does not make the message secret. It also does not establish a real-world identity unless the public key is reliably associated with that identity. A stolen signing key can undermine that assurance.

Do not teach a signature as universally “encrypting the message with the private key”. Signature schemes use their own procedures, often involving a digest. Some signature algorithms are not encryption algorithms at all.

GoalKey used for the first operationKey used for the corresponding operation
Encrypt a message for BobBob’s public encryption keyBob’s private decryption key
Verify that Alice signed specified dataAlice’s private signing key makes the signatureAlice’s public verification key checks it

08 | CHOOSE THE CORRECT KEY ROLE

Select a goal and a proposed key. The activity explains which key belongs to which operation. It is a role model, not an implementation of cryptography, and assumes suitable algorithms and an authentic association between names and keys.

09 | CERTIFICATES: BIND A NAME TO A PUBLIC KEY

A digital certificate is signed information binding a public key to specified identity information under a trust model. For a web server, the relevant identity commonly includes the domain names the certificate covers.

A certificate typically includes the public key, identity/name information, issuer, validity period, serial number and permitted uses or other extensions. The issuer’s digital signature protects the signed information against unnoticed alteration.

A certificate authority (CA) issues certificates after the relevant validation process. A browser commonly checks a chain through intermediate issuers to a trust anchor it is configured to accept. The server does not send its private key inside its certificate.

Different certificates make different identity claims. A domain-validation certificate is not an audit of a business’s honesty or every page of its website. A public key and certificate may be public without weakening the required secrecy of the private key.

10 | WHAT THE CLIENT NEEDS TO CHECK

Receiving a certificate is not enough. The client must check that it covers the requested name, is within its valid period, has an acceptable signature and trust path, and satisfies relevant usage and protocol requirements. Status or revocation information may also be considered according to the client and deployment.

The server must also prove control of the private key associated with the certificate in the authenticated handshake. Copying someone’s public certificate alone should not let an attacker impersonate them successfully.

A hostname mismatch means the certificate does not authenticate the requested name under the relevant rules. An expired or untrusted certificate raises a different validation problem. These are not merely cosmetic browser warnings.

The next activity uses declared conditions for one exact example name. It does not parse real certificates, evaluate wildcard rules or perform real signature, chain or revocation checks.

Requested service: portal.example

11 | HOW SYMMETRIC AND PUBLIC-KEY METHODS COOPERATE

A secure connection needs both efficient data protection and a trustworthy way to establish the necessary secrets. A common modern approach uses public-key techniques for authenticated key establishment and symmetric authenticated encryption for application traffic.

In a simplified certificate-authenticated TLS 1.3 example, peers exchange key-agreement information and derive shared secrets. The server’s certificate and handshake signature help authenticate the exchange. Both peers derive traffic keys rather than simply sending a long-term private key across the network.

This differs from the common old textbook sketch “encrypt a session key with the server’s public key”. That sketch describes a possible hybrid encryption design, but it is not how a typical ephemeral TLS 1.3 key-agreement handshake works.

You do not need the key-agreement mathematics here. Keep three roles distinct: certificate/signature authentication, establishment and derivation of secrets, and symmetric protection of the subsequent data.

12 | FOLLOW A SIMPLIFIED TLS CONNECTION

The walkthrough assumes a fresh, successful, certificate-authenticated modern TLS connection with ephemeral key agreement. It omits resumption, early data, optional client certificates and detailed message ordering so that each security purpose remains clear.

Public exchange information does not mean the shared traffic secrets are sent in plaintext. The client and server derive those secrets through the protocol. Correct authentication binds the exchange to the intended endpoint.

13 | WHAT SECURE TLS DOES AND DOES NOT ESTABLISH

When correctly configured and validated, TLS can protect the confidentiality and integrity of the relevant connection and authenticate the server endpoint. Suitable deployments can also authenticate clients, but ordinary website TLS does not automatically identify the human user.

A site may still need a separate sign-in and application permission checks. A valid certificate for a phishing site’s own name does not make its content honest. Malware on a device may access information before encryption or after decryption.

TLS protection ends at its connection endpoints. If a reverse proxy terminates TLS and makes a separate backend connection, that onward path needs its own suitable protection. The certificate does not magically encrypt every later database or storage operation.

“SSL certificate” remains a common label, but SSL protocols are obsolete; modern secure connections use TLS. Treat certificate terminology and the actual negotiated protocol as related but distinct.

14 | KEY MANAGEMENT: SECURITY OVER THE WHOLE LIFECYCLE

Key management covers generating, establishing, storing, using, replacing and retiring keys. A sound algorithm cannot compensate for a secret copied into a public code repository or shared with an unauthorised person.

Generation needs an appropriate cryptographically secure source and supported algorithm/key parameters. Distribution or agreement must authenticate the intended parties. Storage should limit access and exposure, for example through suitable managed key storage or hardware protection where appropriate.

Use keys only for their intended purposes and permitted lifetimes. Separate signing, encryption and traffic roles where the design requires it. Some cryptographic constructions also have strict requirements for nonces or other parameters; these are not optional details to improvise.

Monitor access, assign responsibility and plan compromise response. Key management includes people and procedures as well as mathematical values.

15 | COMPROMISE, EXPIRY, LOSS AND RECOVERY

If a server private key is exposed, an attacker may be able to misuse the associated identity under relevant conditions. The response can require replacing the key and certificate, revoking affected certificates where applicable, investigating exposure and updating dependent systems.

Replacing a long-term key does not automatically make previously stolen plaintext secret again. In a suitable ephemeral protocol, forward secrecy can protect past session secrets from later long-term key compromise, but this depends on the protocol and does not protect already compromised endpoints or recorded plaintext.

Losing the only key needed to decrypt stored data can make the data unrecoverable. Appropriate controlled recovery arrangements may therefore be needed for long-lived storage keys. Not every ephemeral session key should be backed up indefinitely; retaining unnecessary secrets creates risk too.

Certificate renewal and key rotation are related lifecycle tasks, not identical actions. Track expiry, replace compromised material and securely retire keys when no longer needed, while preserving only the recovery material justified by the system’s requirements.

16 | NETWORK TRAFFIC AND STORED DATA

Network and database systems can use the same broad families of cryptographic algorithms. For example, symmetric cryptography can protect traffic and stored records, while public-key techniques can support authentication or key establishment. Their contexts and management requirements differ.

Encryption in transit protects an exchange between defined endpoints. Encryption at rest protects stored representations. Database encryption does not necessarily stop a legitimate application account from querying decrypted records, and transport encryption does not protect a stolen unencrypted backup.

This is why access permissions, secure key storage and backup design still matter. Keep the protection boundary explicit rather than saying “the data is encrypted” without specifying where and against which exposure.

A practical school plan might use validated TLS for the portal connection, suitable encryption for stored sensitive information and separate managed keys with controlled access and recovery policies.

17 | CHECK THE DISTINCT SECURITY ROLES

Select the concept matching the stated operation. Some situations include several cryptographic mechanisms; focus on the particular role described.

18 | DESCRIBE A COMPLETE PROCESS WITHOUT MIXING THE KEYS

For describe, give the main features and steps. Compare symmetric shared secrets with asymmetric key pairs, identify whose key performs each operation and explain how certificates help establish trust in a public key.

A clear answer can say: “Symmetric encryption uses shared secret key material for efficient data protection. Public-key cryptography uses related public and private keys for supported operations. For confidentiality in a public-key encryption scheme, the recipient’s public key encrypts and their private key decrypts. For a signature, the signer’s private key signs and their public key verifies.”

Then describe certificates and connection setup: “The client validates the certificate’s identity, trust and relevant conditions, and the server proves control of its private key. In a modern authenticated TLS key-agreement exchange, the peers derive secrets and use symmetric traffic protection. Keys must be generated, stored, used and retired securely.”

Avoid claiming that a certificate contains a private key, a signature hides the message, TLS always sends a session key encrypted with the certificate key, or encryption removes the need for authorisation and endpoint security.

MATCH THE CRYPTOGRAPHIC IDEA TO ITS ROLE

Terminology

Terminology

Plaintext

Readable data before encryption or after successful decryption.

Ciphertext

Data produced by encryption.

Encryption

Transforming plaintext into ciphertext using a cryptographic scheme and key.

Decryption

Recovering plaintext with the appropriate key and conditions.

Algorithm

The specified mathematical procedure, distinct from the key value.

Cryptographic key

A value controlling a supported cryptographic operation.

Symmetric cryptography

Cryptography based on shared secret key relationships.

Asymmetric cryptography

Cryptography using related public and private keys for supported operations.

Public key

A key that can be distributed for its intended public-key operation.

Private key

Secret key material protected by the holder of an asymmetric key pair.

Public-key encryption

Protecting content for a recipient using their public key in a suitable encryption scheme.

Digital signature

A private-key signing and public-key verification mechanism for specified data.

Signature verification

Checking a signature against data using the appropriate public key and scheme.

Hash digest

A fixed-size output of a cryptographic hash, not ciphertext designed for decryption.

Encoding

Changing representation, such as Base64, without cryptographic secrecy.

Key agreement

A protocol enabling parties to establish shared secret material without transmitting that secret directly.

Digital certificate

Signed information binding identity information and a public key under a trust model.

Certificate authority

An issuer providing certificates after its relevant validation process.

Trust anchor

A trusted starting point for validating a certificate path.

Certificate chain

Linked issuer certificates supporting a path toward an accepted trust anchor.

Certificate validity period

The time interval during which a certificate may satisfy its time-validity requirement.

Private-key proof

A protocol demonstration of control of the private key associated with the authenticated public key.

TLS

Transport Layer Security, protecting correctly configured authenticated connections.

Traffic key

Key material used to protect a particular direction or purpose of connection traffic.

Authenticated encryption

A construction protecting confidentiality and detecting unauthorised modification under its rules.

Key management

Generation, establishment, storage, use, replacement and retirement of key material.

Key rotation

Replacing key material under a planned or incident-driven policy.

Revocation

Indicating that a certificate should no longer be accepted under the relevant status rules.

Forward secrecy

Protection of past session secrets against later long-term key compromise in a suitable protocol.

Encryption at rest

Protection of stored data representations, distinct from transport protection.

Questions

Questions

CHECK YOUR UNDERSTANDING

Select all correct choices. Each exact set earns one point.

1. Which correctly distinguish basic terms?
2. Which describe symmetric protection?
3. Which describe asymmetric methods?
4. Which keys fit public-key confidentiality for Bob?
5. Which describe Alice’s signature?
6. Which belong in a public certificate or its validation?
7. Which are accurate about TLS?
8. Which limit a certificate’s assurance?
9. Which are key-management tasks?
10. Which are careful scope statements?

EXPLAIN AND COMPARE

Write your answers before revealing each sample.

1. Describe encryption and distinguish encoding.

2. Compare symmetric and asymmetric cryptography.

3. Describe public-key encryption of a message for Bob.

4. Describe Alice signing a document.

5. Describe what a digital certificate contains and why it matters.

6. Describe client checks during certificate-authenticated connection setup.

7. Describe a simplified modern TLS key-establishment process.

8. Explain why a certificate is not the session encryption key.

9. Describe secure key management.

10. Describe consequences of stolen and lost keys.

11. Describe what valid TLS does not guarantee.

12. Compare encryption in transit and at rest.

DESCRIBE IT | A SECURE SCHOOL PORTAL

Describe how a client can authenticate the intended school portal and establish protected application traffic. Distinguish certificate/public-key authentication from key agreement and symmetric traffic protection. Explain whose keys encrypt/decrypt in a suitable public-key message scheme and whose keys sign/verify. Include secure key storage, compromise response and a clear limit of the protection.

Flashcards

Flashcards

Click to flip. Select the ideas you need to revisit.

0 cards selected for revision.

    Selections are kept while this page is open.

    Workbook

    Workbook

    COMING SOON

    The workbook for A2.4.4 Encryption and Digital Certificates is coming soon. Complete the matching task and written questions in your exercise book.