Computer Networks Essentials / Network Security

Encryption Basics

๐Ÿค” What is Encryption? (Basic Idea)

When data travels over a network, anyone in between can see it unless it is protected.

๐Ÿ“Œ Encryption hides the actual data so that only authorized users can understand it.


๐Ÿง  Simple Definition

๐Ÿ“Œ Encryption is the process of converting readable data (plaintext) into an unreadable form (ciphertext) using an algorithm and a key.


๐Ÿง  Why Encryption is Needed

Encryption protects data from:

  • ๐Ÿ•ต๏ธ Eavesdropping

  • ๐Ÿ”“ Unauthorized access

  • โœ๏ธ Data modification

  • ๐Ÿ’ณ Identity theft

๐Ÿ“Œ Without encryption โ†’ data is exposed โŒ


๐Ÿง  Real-Life Analogy

๐Ÿ“ฆ Locked Box Example

  • Message written on paper โœ‰๏ธ

  • Put inside a locked box ๐Ÿ”’

  • Only person with the key can open it ๐Ÿ—๏ธ

๐Ÿ‘‰ Encryption = Locking the data

๐Ÿ‘‰ Decryption = Unlocking the data


๐Ÿ” Basic Encryption Process

1๏ธโƒฃ Sender has Plaintext

2๏ธโƒฃ Encryption algorithm + Key applied

3๏ธโƒฃ Plaintext โ†’ Ciphertext

4๏ธโƒฃ Ciphertext sent over network

5๏ธโƒฃ Receiver uses key to Decrypt

6๏ธโƒฃ Original plaintext recovered


๐Ÿงพ Important Terms

Term

Meaning

Plaintext

Original readable data

Ciphertext

Encrypted unreadable data

Encryption

Converting plaintext to ciphertext

Decryption

Converting ciphertext to plaintext

Key

Secret value used for encryption/decryption

Algorithm

Mathematical method used


๐Ÿ” Types of Encryption

Encryption is mainly classified into two types:

1๏ธโƒฃ Symmetric Key Encryption

2๏ธโƒฃ Asymmetric Key Encryption


๐Ÿ”‘ 1. Symmetric Key Encryption

๐Ÿง  What is Symmetric Encryption?

๐Ÿ“Œ Same key is used for both encryption and decryption.

๐Ÿ‘‰ Sender and receiver must share the secret key.

๐Ÿง  Example

  • Lock ๐Ÿ”’ and key ๐Ÿ—๏ธ are same

  • Anyone with the key can open it

๐Ÿ“Œ Popular Symmetric Algorithms

  • AES (Advanced Encryption Standard)

  • DES (Data Encryption Standard)

  • 3DES

โœ… Advantages

  • Very fast โšก

  • Efficient for large data

โŒ Disadvantages

  • Key sharing problem

  • If key is stolen โ†’ data compromised


๐Ÿ”“ 2. Asymmetric Key Encryption


๐Ÿง  What is Asymmetric Encryption?

๐Ÿ“Œ Uses two different keys:

  • Public Key ๐Ÿ”“

  • Private Key ๐Ÿ”

๐Ÿง  How It Works

  • Public key encrypts data

  • Private key decrypts data

๐Ÿ“Œ Keys are mathematically related.

๐Ÿง  Example

  • Public mailbox ๐Ÿ“ฎ (anyone can drop letters)

  • Private key ๐Ÿ”‘ (only owner can open)

๐Ÿ“Œ Popular Asymmetric Algorithms

  • RSA

  • ECC

  • Diffie-Hellman

โœ… Advantages

  • Secure key exchange

  • No shared secret problem

โŒ Disadvantages

  • Slower than symmetric

  • More computational power


โš–๏ธ Symmetric vs Asymmetric Encryption

Feature

Symmetric

Asymmetric

Keys

One key

Two keys

Speed

Fast

Slow

Security

Medium

High

Key Sharing

Required

Not required

Usage

Bulk data

Key exchange


๐Ÿง  Hybrid Encryption (Real-World Use)

๐Ÿ“Œ In practice, systems use both types.

Example: HTTPS

1๏ธโƒฃ Asymmetric encryption โ†’ exchange key

2๏ธโƒฃ Symmetric encryption โ†’ transfer data

๐Ÿ‘‰ Best of both worlds โœ”๏ธ


๐Ÿ” Encryption and Security Goals

Security Goal

How Encryption Helps

Confidentiality

Hides data

Integrity

Detects modification

Authentication

Verifies sender

Non-repudiation

Prevents denial


๐Ÿง  Encryption in Daily Life

  • HTTPS ๐Ÿ”’

  • Online banking ๐Ÿ’ณ

  • Email security ๐Ÿ“ง

  • VPN ๐ŸŒ

  • Cloud storage โ˜๏ธ

๐Ÿ“Œ Encryption is everywhere.


โš ๏ธ Encryption is NOT Enough Alone

Encryption:

  • Protects data โœ”๏ธ

  • Does not stop DoS โŒ

  • Does not stop malware โŒ

๐Ÿ‘‰ Must be combined with:

  • Firewalls

  • Authentication

  • IDS/IPS


๐Ÿง  Memory Tricks

  • Plaintext = Readable ๐Ÿ“–

  • Ciphertext = Scrambled ๐Ÿ”

  • Symmetric = Same key

  • Asymmetric = Two keys


โญ One-Line Summary

๐Ÿ”น Encryption protects data by converting it into an unreadable form using keys, ensuring confidentiality and secure communication.