In this lesson
- The Big Idea
- Why Do We Need More Than One Technology?
- Two Kinds of Encryption: Symmetric and Public-Key
- How Does an HTTPS Connection Work?
- Two-Factor and Multi-Factor Authentication
- Digital Signatures and Digital Certificates
- How the Technologies Work Together: Buying from an Online Shop
- Try It Yourself
- Common Mistakes
- Key Points
- FAQ
The Big Idea
When you open your banking app or buy something online, no single technology is protecting you. A whole team works together. Encryption stops strangers from reading what travels over the network. A digital certificate helps your browser make sure it is talking to the right server. Two-factor authentication (2FA) makes it hard for anyone to get into your account even if they know your password. A digital signature shows that a signed message has not been changed and really came from its signer. Each one deals with a different threat, and real security comes from combining them, while remembering that they reduce risk rather than remove it completely.
Why Do We Need More Than One Technology?
When you connect to a website, your data passes through many devices and networks you do not own: a café's Wi-Fi, your internet provider, servers along the way. Several different threats can meet you on that journey:
- Eavesdropping: a third party tries to read what you send and receive.
- Tampering: someone tries to change the data on the way, for example the account number in a transfer request.
- Impersonation: a fake site pretends to be your bank, or someone pretends to be you.
- Unauthorised access: someone who has learned your password tries to log in to your account.
These threats are different in nature, so no single technology can handle all of them. Encryption, for instance, stops people reading your traffic, but it does nothing to stop someone who knows your password from logging in. That is the core idea of the whole lesson: online security comes from combining encryption, certificates, signatures and authentication, not from one technology.
Two Kinds of Encryption: Symmetric and Public-Key
Encryption turns readable data into a scrambled form that only someone with the right key can read. The book presents two kinds of encryption, each with a different job.
Symmetric encryption
Symmetric encryption uses one shared key: the same key locks (encrypts) the data and unlocks (decrypts) it. The English edition calls it common-key cryptography.
- Strength: it is fast, so it suits protecting large amounts of data such as web pages, images and order details. The book describes it as the method that "exchanges data quickly".
- Challenge: both sides must hold the same key. How do they get it safely without anyone picking it up on the way? That is where the second kind comes in.
Public-key encryption
Public-key encryption uses a pair of linked keys:
- Public key: can be published and shared with anyone.
- Private key: kept secret by its owner and never shared.
What is locked with the public key can only be opened with the matching private key. The book describes it as the method that helps share keys securely, and it is also used for authentication, proving who the other side is. But it is slower than symmetric encryption, so it is not used to encrypt all the data that is exchanged.
How Does an HTTPS Connection Work?
HTTPS is the HTTP you already know, carried over a secured TLS connection (Transport Layer Security). TLS provides three things:
- Confidentiality of data in transit, so an eavesdropper cannot read it.
- Integrity of data in transit, so tampering is detected.
- Help for the browser to verify the server's identity and domain name.
The steps that set up this secure connection are called the TLS handshake. During it, authentication with the digital certificate and agreement on session keys take place; then data exchange starts using symmetric encryption. We can split what happens into three stages:
| Stage | What happens | Main protection | |---|---|---| | ① Handshake: certificate check | The server sends its digital certificate; the browser checks its validity, its chain of trust and that it matches the site name | Public-key | | ② Handshake: deriving session keys | The two sides negotiate shared secrets, and each derives the session keys from them | Public-key | | ③ Data exchange | Session data is protected with symmetric encryption and integrity mechanisms | Symmetric |
Two things to notice in stage 2
- The session key is not sent over the network. The two sides exchange "parameters" that let them agree, then each side derives the session key itself. So even if someone captures those parameters, they do not get the key from them.
- Session keys belong to the connection: they are created for it and then used with symmetric encryption to protect everything exchanged afterwards.
Why split the work this way?
Because each kind of encryption is used for what it does best:
- Public-key mechanisms solve the trust problem: who am I talking to, and how do we agree on a secret key when we have never met? These steps happen once, at the start.
- Symmetric encryption is fast and efficient, so it can carry the large volume of data exchanged during the session. If all the data were protected with public-key methods, the connection would be slow.
Two-Factor and Multi-Factor Authentication
Authentication means checking a user's identity before giving access. The most common method is a password, but passwords leak: you type one into a fake site, reuse it on another service that gets breached, or someone watches you type it.
Categories of authentication factors
The book groups the things used to prove identity into three categories:
- Knowledge: something you know, such as a password, a PIN or the answer to a secret question.
- Possession: something you have, such as a phone that receives a one-time code, an access card, or an IC card (a smart card with an embedded chip that stores identity data).
- Biometrics: something you are, such as a fingerprint or your face.
2FA and MFA
- Two-factor authentication (2FA): using two independent factors from two different categories to prove identity.
- Multi-factor authentication (MFA): using two or more factors from different categories.
So every 2FA setup is MFA with exactly two factors. The key condition in both is that the factors come from different categories. If a site asks you for two passwords, both are knowledge; that is not 2FA, just two steps of the same kind.
Why does the second factor protect you?
Notice that the Arabic edition says 2FA reduces the likelihood of unauthorised login; it does not claim it prevents it completely.
Examples from real services
| Service | First factor | Second factor | |---|---|---| | Online banking | Password (knowledge) | One-time password, OTP (possession) | | Social media login | Password (knowledge) | SMS code (possession) | | Entering a secured building | Access card (possession) | Fingerprint (biometrics) | | Online shopping | Password (knowledge) | Credit-card identity check (possession) |
Notice in the third row that 2FA does not have to include a password at all; what matters is that the two factors come from different categories.
Digital Signatures and Digital Certificates
Digital signature
A digital signature is attached to specific data or a message and supports verifying two things:
- Integrity: the signed message has not been modified since it was signed.
- Signer identity: it really came from the person or organisation that claims to have sent it.
In this way it helps detect tampering and impersonation. It usually relies on the key pair you met above: only the holder of the private key can sign, and others can check the signature.
A digital signature also provides evidence that supports non-repudiation when the system requires it. Non-repudiation means the signer cannot later deny having signed the message. Picture a manager who digitally signs a decision and later says "I never sent that"; the signature is evidence that it came from them.
Digital certificate
A digital certificate helps the browser verify the server's identity and that the certificate is tied to the domain name it is connecting to. Think of it as the website's ID card, issued by a trusted authority that the browser trusts. When the browser checks the chain of trust, it makes sure the certificate comes from an issuer it trusts, that it is still valid and has not expired, and that it was issued for this exact name.
How the Technologies Work Together: Buying from an Online Shop
The book sums up each technology's role in one table:
| Technology | What it does | |---|---| | Encryption (symmetric and public-key) | Stops third parties reading the content of the communication | | Digital signature | Supports verifying data integrity and signer identity, and provides evidence supporting non-repudiation when needed | | Digital certificate | Helps the browser verify the server's identity and domain name | | Two-factor authentication (2FA) | Reduces the likelihood of unauthorised login |
Now follow them working together as you buy a revision book from an online shop:
- You open the site: an HTTPS connection starts, and encryption stops third parties from reading it.
- The browser checks the digital certificate and domain name to confirm the identity of the server it is connecting to.
- You log in: 2FA asks for your password and a code on your phone, which lowers the chance of anyone else getting into your account.
- You send your order details: TLS protects their confidentiality and integrity in transit. A digital signature is used to prove the signing of specific data or messages when the system requires it.
Combined like this, they reduce the risks of eavesdropping, tampering, impersonation and unauthorised access together, without assuming that any one technology stops a risk completely.
Try It Yourself
Common Mistakes
"HTTPS encrypts all the data with the public key"
Public-key mechanisms are used only in the handshake, for authentication and agreeing session keys. Using them for all the data would make the connection slow.
After the handshake, session data is protected with symmetric encryption, which is fast and efficient for large amounts of data.
"In HTTPS the browser sends the session key, encrypted, to the server"
That describes an older method mentioned in the English edition.
According to the Arabic edition, the two sides negotiate shared secrets and each side derives the session keys itself, without the key being sent over the network.
"Two passwords, or a password plus a secret question, count as 2FA"
They are all knowledge. Whoever steals one can often steal the other the same way.
2FA needs two independent factors from two different categories, such as a password (knowledge) and a code on your phone (possession).
"If a site has the HTTPS padlock, it is trustworthy"
The padlock means the connection is protected, not that the site's content is true or its owners honest.
HTTPS reduces the risks of eavesdropping and tampering, and the certificate ties the server to a domain name, but you still have to check that the domain is the site you meant.
"A digital certificate and a digital signature are the same thing"
Both are about identity, but they answer different questions.
The certificate helps verify the identity of the server you are connecting to and its domain name; the signature supports checking a signed message or data: unchanged, from its signer, and not deniable.
Key Points
- Online security comes from combining encryption, certificates, signatures and authentication; together they reduce risk but give no absolute guarantee.
- Symmetric encryption: one shared key, fast, suited to protecting large amounts of data.
- Public-key encryption: a key pair (a public key to share, a private key kept secret), used for authentication and secure key agreement; slower.
- HTTPS = HTTP over TLS. In the TLS handshake the browser checks the certificate and both sides derive session keys without sending them; then data is protected with symmetric encryption.
- 2FA: two independent factors from two different categories (knowledge, possession, biometrics). MFA: two or more factors.
- A digital signature supports checking a message's integrity and signer, and provides evidence supporting non-repudiation.
- A digital certificate helps the browser verify the server's identity and its link to the domain name.
FAQ
What is the difference between symmetric and public-key encryption, in short?
Symmetric encryption uses one shared key to encrypt and decrypt, and it is fast, so it suits large amounts of data. Public-key encryption uses a pair of linked keys: a public one that can be shared and a private one kept secret by its owner. It is used for authentication and secure key agreement, but it is slower.
Is the session key sent over the internet in HTTPS?
According to the Arabic edition of the book: no. In the TLS handshake the two sides exchange parameters that let them agree on shared secrets, and each side then derives the session keys itself. The English edition describes an older method where the key is sent encrypted, but follow the Arabic edition's description.
Does an SMS code plus a password count as 2FA?
Yes, according to the book: the password is knowledge, and the code that reaches your phone proves possession, so they are two factors from different categories. The condition is always a different category, not just having two steps.
What does non-repudiation mean?
It means there is evidence that stops a signer from later denying that they signed a message or data. A digital signature provides evidence that supports non-repudiation when the system requires it.