Encryption Aur Decryption Kya Hai? (Complete Guide with GPG)
Aaj ke digital daur mein data ki security sabse zyada important hai[cite: 2]. Chahe aapka personal password ho, bank details ho ya confidential files — data ko secure rakhne ke liye Encryption aur Decryption ka use kiya jata hai[cite: 2].
1. Encryption Aur Decryption Kya Hai?
Encryption ka matlab hai kisi sensitive ya secret data ko ek aise format mein convert kar dena jise koi normal person ya hacker padh na sake (unreadable text)[cite: 2].
Example:
Original Data (Plaintext): secret data[cite: 2]
Encryption ke baad (Ciphertext):[cite: 2]
QFnvZbCSffGzrauFXx9icxsN9UHHuU+sCL0sGcUCPGKyRquc9ldAfFIpVI+m8mc/
Ab ye data bilkul random characters jaisa lagta hai aur isse bina key ke samajhna namumkin hai[cite: 2].
🔑 Key Ka Kya Role Hai?
Encryption ke waqt ek Key ka use hota hai jo data ko lock (encrypt) karti hai[cite: 2]. Is encrypted data ko dobara original readable form mein wapas lane ke process ko Decryption kehte hain[cite: 2].
Original Data (Plaintext) ➔ 🔐 Encryption (with Key) ➔ Encrypted Data (Ciphertext) ➔ 🔓 Decryption (with Key) ➔ Original Data (Plaintext)[cite: 2]
2. Encryption Algorithms
Data ko encrypt karne ke liye alag-alag algorithms ka use hota hai[cite: 2]. Kuch popular algorithms hain[cite: 2]:
- AES-128 / AES-256 (Advanced Encryption Standard – Sabse strong aur widely used)[cite: 2]
- 3DES (Triple Data Encryption Standard)[cite: 2]
- Blowfish[cite: 2]
3. Symmetric vs Asymmetric Encryption
| Type | Description | Key Usage |
|---|---|---|
| Symmetric Encryption[cite: 2] | Data ko encrypt aur decrypt karne ke liye ek hi (same) secret key ka use hota hai[cite: 2]. | Single Secret Key[cite: 2] |
| Asymmetric Encryption[cite: 2] | Ismein do alag keys hoti hain: Public Key (encrypt ke liye) aur Private Key (decrypt ke liye)[cite: 2]. | Public + Private Key Pair[cite: 2] |
⚠️ Important Concept Correction: Kuch jagho par likha hota hai ki encryption data ko private key se protect karta hai[cite: 2]. Ye completely accurate nahi hai! Symmetric encryption mein same key use hoti hai, jabki Asymmetric encryption mein public aur private key pair ka combo hota hai[cite: 2].
4. Practical Guide: Linux Mein File Ko Encrypt Aur Decrypt Kaise Karein?
Maan lo hamare paas ek text file hai jisme sensitive credentials hain[cite: 2]:
$ cat secret.txt
username: admin
password: MySecretPassword123
Step 1: GPG Se Encrypt Karna (Symmetric AES-256)
Linux mein GPG (GNU Privacy Guard) ka use karke hum file ko encrypt kar sakte hain[cite: 2]:
$ gpg --cipher-algo AES256 -c secret.txt
Command Breakdown:
gpg: Encryption tool[cite: 2]--cipher-algo AES256: High-level AES-256 algorithm select karta hai[cite: 2]-c: Symmetric encryption (passphrase-based) ke liye[cite: 2]secret.txt: Target file[cite: 2]
Command run karne ke baad GPG aapse passphrase (password) maangega[cite: 2]. Password enter karne ke baad ek nayi file create ho jayegi: secret.txt.gpg[cite: 2]
Step 2: Decrypt Karna
Encrypted file ko wapas readable form mein lane ke liye[cite: 2]:
$ gpg secret.txt.gpg
Sahi password enter karne par aapko original secret.txt file mil jayegi[cite: 2].
🧠 Pro Tip (Passphrase Caching): Linux mein gpg-agent passphrase ko temporary cache mein store rakhta hai taaki bar-bar password na enter karna pade[cite: 2]. Cache expire hone par ya reboot ke baad password dobara maanga jayega[cite: 2].
📌 Quick Summary
- 🔐 Encryption: Readable Data ➔ Unreadable Code[cite: 2]
- 🔓 Decryption: Unreadable Code ➔ Original Data[cite: 2]
- 🔑 Key: Secret required for locking/unlocking[cite: 2]
- 🔄 Symmetric: Same Key for both operations[cite: 2]
- 🔐🔓 Asymmetric: Public Key + Private Key[cite: 2]
Comming soon qustion-answer
