Computer Networks Essentials / Network Security

SSL/TLS

πŸ€” Why Do We Need SSL/TLS? (Basic Idea)

When data travels over the Internet 🌍, it passes through:

  • Routers

  • ISPs

  • Public networks

πŸ“Œ Without protection:

  • Passwords can be stolen πŸ•΅οΈ

  • Data can be modified ✍️

  • Fake websites can trick users 🚨

πŸ‘‰ SSL/TLS protects data while it is in transit.


🧠 Simple Definition

πŸ“Œ SSL/TLS is a security protocol that encrypts communication between a client and a server to ensure confidentiality, integrity, and authentication.


🧠 What is SSL and TLS?

Protocol

Description

SSL

Secure Sockets Layer (older, deprecated)

TLS

Transport Layer Security (newer, secure)

πŸ“Œ TLS is the modern and secure version of SSL, but we still say β€œSSL” commonly.


🧠 Real-Life Analogy

πŸ“ž Secure Phone Call

  • Two people talk

  • Language is scrambled

  • Only they understand it

πŸ‘‰ SSL/TLS:

  • Scrambles data

  • Only sender & receiver can read it


🧭 Where Does SSL/TLS Work?

  • SSL/TLS works between:

    • Application Layer (HTTP)

    • Transport Layer (TCP)

πŸ“Œ That’s why HTTPS = HTTP + SSL/TLS


πŸ”’ What Security Does SSL/TLS Provide?

SSL/TLS ensures four major security services:

πŸ” 1. Confidentiality

  • Data is encrypted

  • Hackers cannot read it

✍️ 2. Integrity

  • Ensures data is not altered

  • Uses hashing & MAC

🧾 3. Authentication

  • Confirms server identity

  • Uses digital certificates

🚫 4. Non-Repudiation (Indirect)

  • Sender cannot deny communication

  • Achieved using certificates & signatures


πŸ”‘ Core Components of SSL/TLS

SSL/TLS uses:

  • πŸ” Encryption algorithms

  • πŸ”‘ Symmetric & asymmetric keys

  • 🧾 Digital certificates

  • πŸ”’ Hash functions


πŸ“œ Digital Certificates

πŸ“Œ A digital certificate:

  • Proves server identity

  • Issued by a Certificate Authority (CA)

Examples of CA:

  • DigiCert

  • GlobalSign

  • Let’s Encrypt


🧾 Certificate Contains

  • Website name

  • Public key

  • CA signature

  • Validity period

πŸ“Œ Browser trusts CA β†’ trusts website βœ”οΈ


πŸ” How SSL/TLS Works (Step-by-Step Handshake)

Let’s understand the TLS Handshake simply πŸ‘‡


πŸͺœ Step-by-Step SSL/TLS Handshake

1️⃣ Client sends Hello

2️⃣ Server sends Certificate

3️⃣ Client verifies certificate

4️⃣ Secure key is exchanged

5️⃣ Session key generated

6️⃣ Encrypted communication begins

πŸ“Œ After handshake β†’ fast symmetric encryption is used ⚑


πŸ”„ Why Both Symmetric & Asymmetric Encryption Are Used?

Stage

Encryption Used

Reason

Handshake

Asymmetric

Secure key exchange

Data transfer

Symmetric

Fast performance

πŸ‘‰ Best of both worlds βœ”οΈ


🌐 SSL/TLS in Real Life

SSL/TLS is used in:

  • HTTPS πŸ”’

  • Online banking πŸ’³

  • Secure email πŸ“§

  • VPN 🌍

  • Cloud services ☁️

πŸ“Œ Look for πŸ”’ lock icon in browser.


πŸ”Œ Ports Used with SSL/TLS

Service

Port

HTTPS

443

SMTPS

465

IMAPS

993

POP3S

995


⚠️ SSL vs TLS

Feature

SSL

TLS

Security

Weak

Strong

Status

Deprecated

Active

Speed

Slower

Faster

Usage

Obsolete

Modern

πŸ“Œ Always use TLS.


❌ Attacks Prevented by SSL/TLS

  • Eavesdropping πŸ•΅οΈ

  • Man-in-the-middle

  • Data tampering

  • Fake websites


⚠️ Limitations of SSL/TLS

  • Does not protect endpoint ❌

  • Cannot stop malware ❌

  • Needs correct certificate management

πŸ“Œ SSL/TLS secures data in transit only.


🧠 Memory Tricks

  • SSL = Secure Socket

  • TLS = Tough Lock System πŸ”

  • 443 = Secure Web

  • πŸ”’ Icon = SSL/TLS active


⭐ One-Line Summary

πŸ”Ή SSL/TLS is a security protocol that encrypts communication, authenticates servers, and ensures data integrity over the Internet.