DEV Community

Shreehari Menon
Shreehari Menon

Posted on • Originally published at meetcyber.net on

How Internet Security Works: TLS, HTTPS & Certificates

The Invisible Handshake: How Your Browser Proves a Website Isn’t an Imposter

1. Introduction: The Postcard and the Imposter

Imagine you are sitting in an airport terminal, waiting for your flight. You connect to the free “Airport_Wi-Fi” network, open your browser, and type bank.com to check your account balance.

In the early days of the internet, the data you sent - like your username and password - traveled across the network exactly like a postcard in the mail. Anyone who handled the postcard along the way (the Wi-Fi router, the Internet Service Provider, or a hacker sitting two seats away) could flip it over and read your password in plain text. This was standard HTTP (Hypertext Transfer Protocol).

To fix this, engineers added encryption, creating HTTPS (Secure HTTP). Now, your postcard was placed inside an indestructible, locked steel box before it was sent over the Wi-Fi.

Problem solved, right? Not exactly.

As we learned previously, to lock that box, your browser needs the Bank’s Public Key. So, your browser asks the network: “Hey, who has the Public Key for bank.com?”

But what if a hacker is running a fake Wi-Fi router? The hacker replies, “I do! Here is the Public Key for bank.com.” Your browser, not knowing any better, uses the hacker’s key to lock the box containing your password. The hacker intercepts the box, opens it with their own Private Key, steals your password, and then forwards your request to the real bank so you never notice a thing.

This is called a Man-in-the-Middle (MITM) attack.

The encryption worked perfectly, but the identity was faked. How does your computer actually know that the Public Key it receives belongs to the real Bank and not an imposter?

This is the ultimate problem of internet security. Today, we will learn how the internet solves it using Digital Certificates , Certificate Authorities , and the TLS Handshake.

2. The Digital Passport: What is a Certificate?

To solve the imposter problem, we need a way to tie a Public Key to a real-world identity. In the physical world, if someone claims to be “John Smith,” you don’t just take their word for it. You ask to see their Passport or Driver’s License.

In the digital world, we use a Digital Certificate (often called an SSL/TLS Certificate).

A Digital Certificate is simply a tiny data file that binds a cryptographic Public Key to a specific organization or website. When you visit bank.com, the server doesn't just hand you a bare Public Key; it hands you its Digital Certificate.

What is inside a Digital Certificate?

If you click the little padlock icon next to the URL in your web browser, you can actually look at the website’s certificate. Inside, you will find:

  1. Subject Identity: The domain name (www.bank.com) and sometimes the company name holding it.
  2. The Public Key: The actual mathematical key used to encrypt data sent to the bank.
  3. Validity Dates: An issue date and an expiration date (certificates expire to ensure security stays up-to-date).
  4. The Issuer: The name of the organization that verified this information.
  5. The Digital Signature: A cryptographic seal applied by the Issuer to prove the certificate hasn’t been forged.


A Digital Certificate binds a website’s identity to its Public Key, proving you are talking to the right server.

3. The VIP List: Certificate Authorities (CAs)

You might have spotted a logical flaw in the certificate system. If a hacker can create a fake Public Key, what stops them from just typing up a fake Digital Certificate to go with it?

If I print a piece of paper on my home printer that says “I am the President,” you wouldn’t believe it. But if the government prints me an official ID card with holograms and watermarks, you trust it.

The internet relies on such “Governments” called Certificate Authorities (CAs).

CAs are highly secure, globally trusted organizations (like DigiCert, GlobalSign, or Let’s Encrypt). Their entire business is verifying identities. If bank.com wants a certificate, they must apply to a CA. The CA investigates, verifies that the applicant actually owns the domain bank.com, and only then do they issue the Digital Certificate.

Crucially, the CA signs the certificate using the CA’s own Private Key.

The Root Store (The Browser’s VIP List):

How does your laptop know to trust DigiCert or Let’s Encrypt?

When you buy a computer or download a web browser (like Chrome, Firefox, or Safari), it comes pre-installed with a highly guarded list called a Root Store. This is a list of about 100 trusted Certificate Authorities and their Public Keys.

The Chain of Trust works like this:

  1. Your browser connects to bank.com and receives a Certificate.
  2. Your browser checks the Certificate’s signature. It says, “This was signed by DigiCert.”
  3. Your browser checks its internal Root Store. “Is DigiCert on my pre-installed VIP list?”
  4. Yes, it is. The browser uses DigiCert’s Public Key from the VIP list to verify the signature on the bank’s certificate.
  5. Because the signature matches, your browser knows the Bank’s certificate is 100% authentic. The green padlock appears.

If a hacker presents a fake certificate, it won’t have a valid signature from a CA on your VIP list. Your browser will instantly throw up a massive, red warning screen: “Your connection is not private.”


Trust flows downward. Your browser trusts the CA, and the CA vouches for the website.

4. The TLS Handshake: Bringing It All Together

Now that we have solved the identity problem, how does the actual secure connection begin?

This process is called the TLS Handshake (Transport Layer Security). TLS is the modern, secure protocol that makes HTTPS possible. (You may also hear it referred to as SSL, which is an older, obsolete version of the same concept).

When you type https://bank.com and press enter, your computer and the server perform a high-speed cryptographic conversation in milliseconds. It utilizes every single tool we have learned about earlier.

Here is a simplified step-by-step of the TLS Handshake:

Step 1: The Client Hello

Your Browser: “Hi server! I want to connect securely. I know how to speak AES (Symmetric) and RSA (Asymmetric). Here is a random string of numbers to start.”

Step 2: The Server Hello & Certificate

The Server: “Hi browser! Let’s use AES and RSA. Here is my Digital Certificate, which contains my Public Key.”

Step 3: Verification & Key Exchange

Your Browser: (Checks the certificate against its Root Store VIP list. The signature matches. The identity is verified.) “Okay, you are definitely the real Bank. I am now going to generate a brand new, temporary Symmetric Key just for us to use today. I will lock this new key inside your Public Key and send it to you.”

Step 4: The Switch to Symmetric

The Server: (Receives the locked message and uses its highly guarded Private Key to unlock it). “I successfully decrypted your message. I now have the temporary Symmetric Key.”

Step 5: Secure Data Transfer

Both sides: Now that both the browser and the server share a fast, Symmetric key that no one else has, they abandon the slow Asymmetric math. They begin exchanging your passwords, account balances, and data at lightning speed, protected by Symmetric Encryption.


The TLS Handshake uses Asymmetric crypto to verify identity and securely swap a Symmetric key for fast communication.

5. Why TLS is the Ultimate Target for Quantum Computers

You have just learned the exact mechanism that secures trillions of dollars in global commerce, military communications, and private messaging every single day.

But as we conclude our foundation in modern cryptography, we must look at the horizon. Why are governments and tech giants panicking about Quantum Computers?

Look back at the TLS Handshake. It relies on Asymmetric Cryptography (like RSA or Elliptic Curves) in two absolutely critical places:

  1. The Digital Signature: The CA uses Asymmetric math to sign the certificate.
  2. The Key Exchange: Your browser uses the server’s Asymmetric Public Key to safely transmit the Symmetric session key.

Quantum computers are uniquely designed to break Asymmetric math. If a hacker gets a powerful quantum computer, they can mathematically reverse-engineer the Private Keys of the Certificate Authorities.

  • They could forge perfect, mathematically valid certificates for bank.com or google.com.
  • They could bypass the Root Store VIP list completely.
  • Your browser would see a green padlock, completely unaware that the TLS handshake is happening with a hacker’s server.

The entire chain of trust would instantly evaporate. This is the “Quantum Apocalypse” scenario that Post-Quantum Cryptography (PQC) is racing to prevent.

Summary

  • HTTP sends data in plain text. HTTPS secures it using the TLS protocol.
  • Man-in-the-Middle (MITM) Attacks happen when a hacker intercepts traffic and provides a fake Public Key.
  • Digital Certificates solve this by acting as a digital passport, binding a Public Key to a real-world identity.
  • Certificate Authorities (CAs) are trusted organizations that issue and digitally sign these certificates. Your browser trusts them via a pre-installed Root Store.
  • The TLS Handshake is the process where a browser and server verify identities (using Certificates) and securely agree on a fast Symmetric key to encrypt the session.

What’s Next?

Now that we have completed the foundations of modern internet security. You know the what and the why of Cryptography.

Next, we will be going to look under the hood at the how. Before we can understand how Post-Quantum algorithms work, we must briefly understand the classical algorithms they are replacing.

In the upcoming article, we will demystify the most famous cryptographic algorithm in the world. We will look at the simple, elegant math that powers those Public and Private keys — and see exactly why it works so beautifully today.


Top comments (0)