← Back|CYBERSECURITYSection 1/16
0 of 16 completed

Encryption basics

Intermediate14 min read📅 Updated: 2026-02-17

Introduction

WhatsApp la message anuppum bodhu "end-to-end encrypted" nu paathiruppinga. ATM la PIN enter pannuringa. Online shopping la credit card details type pannuringa. Ivanga ellam safe ah irukkudhu epdhi? 🤔


Encryption dhaan answer! Data ah readable format la irundhu unreadable format ku convert pannum — authorized people mattum thirumba read panna mudiyum. 🔐


Indha article la encryption types, algorithms, real-world usage, and how it protects us — ellam paapom! 💪

What is Encryption?

Encryption = Plaintext (readable) → Ciphertext (unreadable) convert pannum process.

Decryption = Ciphertext → Plaintext (reverse process).


Simple example:

code
Original:  HELLO WORLD
Key:       Shift by 3 (Caesar Cipher)
Encrypted: KHOOR ZRUOG

H → K (+3)
E → H (+3)
L → O (+3)

Modern encryption romba complex — but concept same dhaan:

  1. Plaintext — Original data 📄
  2. Algorithm — Encryption method (AES, RSA) ⚙️
  3. Key — Secret value used for encrypt/decrypt 🔑
  4. Ciphertext — Encrypted output 🔒

Key illama ciphertext ah yaralum read panna mudiyaadhu! Even if attacker ciphertext intercept pannaalum, key illama useless. 🎯

Symmetric Encryption — One Key

Symmetric Encryption: Same key encrypt and decrypt ku use pannuranga.


🔑 Analogy: Oru lock and key — same key la lock pannu, same key la open pannu.


Popular Symmetric Algorithms:


AlgorithmKey SizeSpeedUsage
**AES-128**128 bitVery Fast ⚡General encryption
**AES-256**256 bitFastMilitary grade, top secret
**ChaCha20**256 bitVery FastMobile, streaming
**3DES**168 bitSlow 🐌Legacy (avoid!)

AES (Advanced Encryption Standard) — King of symmetric encryption! 👑

  • US Government standard
  • Banks, military, everywhere use aagudhu
  • AES-256 brute force panna billions of years aagum

Problem with Symmetric: Key epdhi securely share pannum? 🤔

  • Alice and Bob same key use pannanum
  • Key ah internet la anuppa mudiyaadhu (intercepted aagum!)
  • Idha solve panna → Asymmetric encryption vandhadhu

Asymmetric Encryption — Two Keys

Asymmetric Encryption: Two keys — Public Key (everyone ku share) and Private Key (secret, un kitta mattum).


🔑 Analogy: Mailbox — anyone can drop a letter (public key), but only you have the key to open it (private key).


How it works:

  1. Bob generates key pair: Public Key + Private Key
  2. Bob shares Public Key with everyone
  3. Alice encrypts message with Bob's Public Key
  4. Only Bob can decrypt with his Private Key

code
Alice                          Bob
  |                              |
  |-- Encrypt(PublicKey_Bob) --> |
  |   "Hello Bob!"              |
  |   → "x7#k9@mQ..."          |
  |                              |-- Decrypt(PrivateKey_Bob)
  |                              |   → "Hello Bob!" ✅

Popular Asymmetric Algorithms:


AlgorithmKey SizeUsage
**RSA**2048-4096 bitDigital signatures, key exchange
**ECC**256-384 bitMobile, IoT (smaller keys, same security)
**Diffie-Hellman**2048+ bitKey exchange
**Ed25519**256 bitSSH keys, modern signatures

Asymmetric slower than symmetric — adhukku usually hybrid approach use pannuranga. 🔄

Hybrid Encryption — Best of Both

Example

Real-world HTTPS uses hybrid encryption:

1. 🤝 Handshake (Asymmetric — RSA/ECC):

- Browser server oda public key receive pannum

- Random symmetric key generate pannum

- Symmetric key ah public key la encrypt panni anuppum

2. 🔒 Data Transfer (Symmetric — AES):

- Both sides ippo same symmetric key vachirukku

- All data AES la encrypt/decrypt — super fast!

Why hybrid?

- Asymmetric: Secure key exchange ✅ but slow ❌

- Symmetric: Super fast ✅ but key sharing problem ❌

- Hybrid: Best of both! ✅✅

Every time you see 🔒 in browser URL — this hybrid magic nadakkudhu! ✨

Hashing — One-Way Function

Hashing ≠ Encryption! Hashing is one-way — reverse panna mudiyaadhu.


Use cases: Password storage, data integrity verification, digital signatures.


code
Input: "password123"
SHA-256 Hash: ef92b778bafe771e89245b89ecbc08a44a4e166c06659911881f383d4473e94f

Input: "password124" (one character change!)
SHA-256 Hash: 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8

Completely different output! (Avalanche Effect) 🌊

Popular Hash Algorithms:


AlgorithmOutput SizeStatus
**MD5**128 bit❌ Broken — don't use!
**SHA-1**160 bit❌ Deprecated
**SHA-256**256 bit✅ Widely used
**SHA-3**256/512 bit✅ Latest standard
**bcrypt**184 bit✅ Best for passwords
**Argon2**Configurable✅ Password hashing winner

⚠️ Passwords: Never store plain text! Always use bcrypt or Argon2 with salt.


code
Plain: "mypassword"
Salt:  "x7k9m2" (random)
Hash:  bcrypt("mypassword" + "x7k9m2") → "$2b$12$..."

Same password, different salt = different hash! 
Attackers can't use pre-computed tables (rainbow tables) 🌈❌

Digital Signatures

Digital Signatures = Encryption + Hashing combine panni authenticity verify pannum.


How it works:

  1. Sender message hash pannum (SHA-256)
  2. Hash ah sender's private key la encrypt pannum → Signature
  3. Message + Signature anuppum
  4. Receiver signature ah sender's public key la decrypt pannum
  5. Receiver independently message hash pannum
  6. Both hashes match → Message authentic and untampered! ✅

code
Sender (Alice):
  Message → SHA-256 → Hash
  Hash + PrivateKey_Alice → Digital Signature
  Send: Message + Signature

Receiver (Bob):
  Signature + PublicKey_Alice → Decrypted Hash
  Message → SHA-256 → Computed Hash
  Decrypted Hash == Computed Hash? → VALID ✅

Real-world uses:

  • 📧 Email signing (S/MIME, PGP)
  • 📜 Software updates (code signing)
  • 📄 PDF document signing
  • 🪙 Bitcoin transactions
  • 🏛️ Government e-documents

TLS/SSL — Securing the Web

TLS (Transport Layer Security) = HTTPS la "S" — web traffic encrypt pannum.


TLS Handshake (simplified):

  1. Client Hello → Browser supported ciphers anuppum
  2. Server Hello → Server cipher select pannum + certificate anuppum
  3. Certificate Verify → Browser certificate validate pannum (CA check)
  4. Key Exchange → Symmetric session key generate pannuranga
  5. Encrypted Communication → AES la data flow! 🔒

TLS Versions:

  • TLS 1.0, 1.1 — ❌ Deprecated (vulnerabilities!)
  • TLS 1.2 — ✅ Currently widely used
  • TLS 1.3 — ✅ Latest, fastest, most secure

TLS 1.3 improvements:

  • Faster handshake (1-RTT vs 2-RTT)
  • Removed weak ciphers
  • Forward secrecy mandatory
  • 0-RTT resumption possible ⚡

Encryption at Rest vs in Transit

Data two states la encrypt pannanum:


🗄️ Encryption at Rest — Stored data protect pannum:

  • Hard drive encryption (BitLocker, FileVault)
  • Database encryption (TDE — Transparent Data Encryption)
  • Cloud storage encryption (S3 server-side encryption)
  • Phone encryption (iOS/Android device encryption)

🌐 Encryption in Transit — Moving data protect pannum:

  • HTTPS/TLS — Web traffic
  • VPN — Tunnel encryption
  • SSH — Remote access
  • WhatsApp — End-to-end encryption

🔑 Encryption in Use — Processing data protect pannum (emerging!):

  • Homomorphic encryption — Encrypted data la calculations!
  • Secure enclaves (Intel SGX, AWS Nitro)
  • Confidential computing

StateWhatExample
**At Rest**Stored dataEncrypted hard drive 🗄️
**In Transit**Moving dataHTTPS connection 🌐
**In Use**Processing dataSecure enclave 🔒

Encryption Architecture in Apps

🏗️ Architecture Diagram
```
┌──────────────────────────────────────────────┐
│        Application Encryption Architecture    │
├──────────────────────────────────────────────┤
│                                                │
│  ┌──────────┐   TLS 1.3    ┌──────────────┐ │
│  │  Client   │ ◄──────────► │  API Gateway │ │
│  │ (Browser) │  🔒 Transit  │  (HTTPS)     │ │
│  └──────────┘              └──────┬───────┘ │
│                                    │         │
│                              ┌─────▼──────┐ │
│                              │  App Server │ │
│                              │  (Decrypt/  │ │
│                              │   Encrypt)  │ │
│                              └─────┬───────┘ │
│                                    │         │
│              ┌─────────────────────┼────┐    │
│              ▼                     ▼    │    │
│  ┌────────────────┐  ┌──────────────┐  │    │
│  │   Database      │  │  File Store  │  │    │
│  │  (AES-256 TDE)  │  │  (SSE-KMS)  │  │    │
│  │  🔒 At Rest     │  │  🔒 At Rest  │  │    │
│  └────────────────┘  └──────────────┘  │    │
│              │                          │    │
│              └──────────┬───────────────┘    │
│                         ▼                    │
│              ┌──────────────────┐            │
│              │   Key Management │            │
│              │   Service (KMS)  │            │
│              │   🔑 Master Keys │            │
│              └──────────────────┘            │
└──────────────────────────────────────────────┘
```

Key Management — Most Critical!

⚠️ Warning

🔑 Key Management encryption la most important and most difficult part!

Rules:

- ❌ Keys ah code la hardcode pannaadheenga!

- ❌ Keys ah plain text la store pannaadheenga!

- ✅ Use KMS (AWS KMS, Azure Key Vault, HashiCorp Vault)

- ✅ Rotate keys regularly

- ✅ Separate encryption keys and data

- ✅ Backup keys securely

Key Rotation: Regular ah old keys retire panni new keys generate pannunga. Oru key compromise aanaalum, old data safe.

Remember: Encryption is only as strong as key management! Best algorithm + bad key management = no security. 🚫

Practical Encryption Tips

💡 Tip

💡 Developer Tips:

- Always use TLS 1.2+ for all connections

- Use AES-256-GCM for symmetric encryption (authenticated!)

- Use RSA-2048 minimum (4096 recommended)

- Use bcrypt/Argon2 for passwords

- Never implement your own crypto algorithm! 🚫

- Use well-tested libraries: OpenSSL, libsodium, Web Crypto API

🛠️ Practice:

- OpenSSL commands: openssl enc -aes-256-cbc

- Let's Encrypt: Free TLS certificates

- GPG: Email encryption practice

- CyberChef: Online encryption tool (GCHQ)

Summary

Key Takeaways 🎯:


  1. Symmetric = Same key, fast, bulk data (AES)
  2. Asymmetric = Two keys, slower, key exchange (RSA, ECC)
  3. Hybrid = Both combine — real world uses this (TLS)
  4. Hashing = One-way, passwords and integrity (bcrypt, SHA-256)
  5. Digital Signatures = Authenticity + integrity verify
  6. Key Management = Most critical part of encryption
  7. Encrypt everywhere — at rest, in transit, in use!

Encryption is the backbone of cybersecurity. Idhu illama internet safe ah use panna mudiyaadhu! 🔐

🏁 Mini Challenge

Challenge: Implement End-to-End Encryption


3 weeks time la practical encryption setup pannunga:


  1. Symmetric Encryption Practice — OpenSSL use panni file encrypt pannunga: openssl enc -aes-256-cbc -in file.txt -out file.enc. Decrypt pannunga back.

  1. Asymmetric Encryption Lab — RSA key pair generate pannunga: openssl genrsa -out private.pem 2048. Public key extract pannunga. Friend la public key share panni message encrypt panni, private key use panni decrypt pannunga.

  1. HTTPS Certificate — Self-signed certificate create pannunga: openssl req -x509 -newkey rsa:4096. Un local web server (Apache/Nginx) la configure pannunga. Browser trust warning understand pannunga.

  1. GPG Encryption — GnuPG install pannunga. Key pair generate pannunga. Friend's public key import pannunga. Encrypted email send-receive practice pannunga.

  1. Hash Function — SHA-256 hashes generate pannunga (passwords, files). Hash collision impossible understand pannunga.

  1. Key Management — Private keys securely store pannunga (encrypted storage, offline backup). Key rotation schedule create pannunga.

Certificate: Nee cryptography engineer! 🔐🔑

Interview Questions

Q1: Symmetric vs Asymmetric encryption — use cases?

A: Symmetric = fast, shared key (AES). Files encrypt pannuradhu, database encryption. Asymmetric = slow, public-private (RSA). Key exchange, digital signatures. Hybrid = asymmetric use panni symmetric key exchange pannum.


Q2: HTTPS certification process — how does trust establish?

A: Certificate Authority (CA) issue pannum certificate. CA verified, domain ownership proven. Browser la pre-installed root certificates. Certificate chain verify pannunum. Valid SSL certificate = padlock icon = secure.


Q3: Key Management — enterprise perspective la critical?

A: Very critical! Key generation, storage, rotation, revocation — systems required. Hardware security modules (HSM) use pannunga critical keys la. Key management service (AWS KMS) cloud la. Unauthorized access = all encryption worthless.


Q4: Perfect Forward Secrecy (PFS) — epdhi cybersecurity improve pannum?

A: Session key separate, master key compromise-um previous sessions safe irukkum. Key exchange mechanism elliptic curve use pannum (ECDHE). Long-term key exposed-um historic traffic decrypt panna mudiyaadhu.


Q5: Post-quantum cryptography — future preparation?

A: Quantum computers break current RSA/ECC algorithms. New algorithms develop pannidranga (lattice-based, hash-based). Transition gradually — hybrid algorithms implement panni, keys lengthen panni. 5-10 years major shift expected.

Frequently Asked Questions

Encryption vs Hashing — enna difference?
Encryption reversible — key use panni decrypt pannalam. Hashing one-way — original data ku thirumba poga mudiyaadhu. Passwords hash pannuranga, messages encrypt pannuranga.
AES vs RSA — edhula use pannuradhu?
AES symmetric (fast, bulk data ku). RSA asymmetric (key exchange, digital signatures ku). Usually both combine: RSA key exchange pannum, AES data encrypt pannum.
HTTPS la encryption epdhi work aagudhu?
TLS handshake la server certificate verify pannum, key exchange nadakkum (asymmetric), pudhu actual data AES la encrypt aagum (symmetric). Best of both worlds!
Quantum computers encryption ah break pannuma?
RSA, ECC maari current asymmetric algorithms ah quantum computers break pannalaam. Adhukku dhaan post-quantum cryptography research nadakkudhu. AES-256 quantum-safe nu consider pannuranga.
🧠Knowledge Check
Quiz 1 of 2

Symmetric encryption la enna key use pannuranga?

0 of 2 answered