← Back|CYBERSECURITY›Section 1/16
0 of 16 completed

Encryption basics

Intermediateā± 14 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