🔐 Encryption, Hashing & Digital Certificates
Complete Study Notes for Government, Banking, SSC, UPSC, Railway & Other Competitive Exams
📊 All Key Comparison Tables 📝 50+ MCQs with Explanations 🇮🇳 India-Specific Content ⚡ Quick Revision Cheat SheetEncryption = Converting readable data (Plaintext) into unreadable form (Ciphertext) using an algorithm and a key. Only someone with the correct key can read the data back.
Original Data
Encrypt
Scrambled Data
Decrypted
🔵 Symmetric Encryption
- One shared key for both encrypt & decrypt
- Fast — ideal for large data
- Key must be shared securely (biggest challenge)
- Examples: AES, DES, 3DES, RC4, Blowfish
- Used for: File encryption, VPNs, Wi-Fi (WPA2)
- Memory trick: “Single Key = Speed”
🟣 Asymmetric Encryption
- Two keys: Public key (encrypts) + Private key (decrypts)
- Slower — used for small data / key exchange
- Public key can be shared openly — private key stays secret
- Examples: RSA, ECC, Diffie-Hellman, DSA
- Used for: HTTPS, digital signatures, email security
- Memory trick: “A Pair = Added Security”
| Algorithm | Type | Key Size | Used For | Status |
|---|---|---|---|---|
| AES | Symmetric | 128/192/256-bit | Wi-Fi (WPA2/WPA3), VPN, disk encryption, banking | ✅ Current Standard |
| DES | Symmetric | 56-bit | Old banking systems (legacy) | ❌ Obsolete / Broken |
| 3DES (Triple DES) | Symmetric | 112/168-bit | Legacy banking, ATMs | ⚠️ Being Phased Out |
| RSA | Asymmetric | 2048/4096-bit | HTTPS, digital signatures, email security | ✅ Widely Used |
| ECC | Asymmetric | 256-bit (= RSA 3072-bit security) | Mobile, IoT, modern TLS, cryptocurrency | ✅ Growing Use |
| Diffie-Hellman | Asymmetric (Key Exchange) | Variable | Securely sharing encryption keys over public channel | 📌 Key Exchange Only |
| RC4 | Symmetric (Stream) | 40-2048-bit | Old SSL/TLS, WEP Wi-Fi | ❌ Broken / Deprecated |
| Use Case | Encryption Type | Example |
|---|---|---|
| Secure websites | Asymmetric + Symmetric (Hybrid) | HTTPS — TLS uses RSA for key exchange, AES for data |
| WhatsApp / Signal messages | Hybrid (End-to-End) | Signal Protocol — AES + Curve25519 |
| VPN connections | Symmetric | AES-256 used in OpenVPN, IPSec |
| Wi-Fi security | Symmetric | WPA2 uses AES; WEP (old, broken) |
| Disk/file encryption | Symmetric | BitLocker (AES), VeraCrypt |
| Banking/ATM transactions | Symmetric / Hybrid | 3DES (old), AES (new) |
| Cryptocurrency wallets | Asymmetric | ECC (Bitcoin uses secp256k1) |
| Digital signatures | Asymmetric (private key signs) | RSA, DSA, ECDSA |
Hashing = Converting any input data into a fixed-length string (called a hash, digest, or checksum) using a mathematical function. The same input always gives the same output. The process is one-way — cannot be reversed.
| Property | What It Means | Example |
|---|---|---|
| Deterministic | Same input ALWAYS gives same output | “hello” → same hash every time |
| Fixed Length Output | Output size is always the same, regardless of input size | SHA-256 = always 256 bits |
| One-Way (Irreversible) | Cannot reverse-engineer the input from the hash | Cannot get “password” back from its hash |
| Avalanche Effect | Tiny change in input → completely different hash | “hello” vs “Hello” → totally different hashes |
| Collision Resistant | Extremely hard to find two different inputs with same hash | MD5 FAILED this — it’s broken |
| Fast to Compute | Hashing should be quick to calculate | SHA-256 is fast; bcrypt is intentionally slow |
| Algorithm | Output Size | Used For | Security Status |
|---|---|---|---|
| MD5 | 128-bit (32 hex chars) | File checksums (legacy), non-security use | ❌ BROKEN — Collisions Found |
| SHA-1 | 160-bit (40 hex chars) | Old SSL certificates, Git commit IDs | ❌ WEAK — Deprecated 2017 |
| SHA-256 | 256-bit (64 hex chars) | SSL certificates, Bitcoin, file verification, passwords | ✅ SECURE — Current Standard |
| SHA-512 | 512-bit (128 hex chars) | High-security applications, password hashing | ✅ Very Secure |
| SHA-3 | 224/256/384/512-bit | Next-generation alternative to SHA-2 | ✅ Very Secure |
| bcrypt | 60 characters (fixed) | Password storage in databases | ✅ Best for Passwords (slow by design) |
| Argon2 | Variable | Password hashing (winner of PHC 2015 competition) | ✅ Best Modern Password Hash |
| CRC32 | 32-bit | Error detection in data transmission (NOT for security) | ⚠️ Error Detection Only |
- Password Storage: Websites store hash of your password, not the actual password. When you log in, your entry is hashed and compared.
- File Integrity Verification: Download a file → compare its SHA-256 hash with the published one → if they match, file is genuine and untampered.
- Digital Signatures: The message is hashed first, then the hash is signed with a private key (not the full message, which is too large).
- Blockchain Technology: Each block contains the hash of the previous block, creating a tamper-evident chain. Bitcoin uses SHA-256.
- Data Deduplication: Cloud storage systems hash files to detect duplicate copies and save storage space.
- Message Authentication Code (HMAC): Hash + secret key → used to verify both integrity AND authenticity of messages.
| Concept | What It Is | Purpose |
|---|---|---|
| Salt | Random data added to a password BEFORE hashing | Prevents rainbow table attacks; same password → different hashes for each user |
| Pepper | Secret value added in addition to salt (stored separately from DB) | Extra protection even if database is stolen |
| Rainbow Table | Pre-computed table of passwords and their hashes | Used by attackers to reverse hashed passwords — defeated by salting |
| Key Stretching | Running the hash function many times (iterations) | Makes brute-force attacks much slower (bcrypt, PBKDF2 do this) |
| Feature | Encryption | Hashing | Encoding |
|---|---|---|---|
| Purpose | Confidentiality (hide data) | Integrity (verify data) | Format conversion (NOT security) |
| Reversible? | ✅ Yes — with the correct key | ❌ No — one-way process | ✅ Yes — anyone can decode |
| Uses Key? | ✅ Yes (symmetric or asymmetric) | ❌ No key (HMAC uses a key) | ❌ No key needed |
| Output Size | Variable (same or larger than input) | Fixed length always | Larger than input |
| Examples | AES, RSA, ECC | SHA-256, MD5, bcrypt | Base64, URL encoding, ASCII |
| Used For | Secure data transmission, storage | Passwords, file integrity, blockchain | Email attachments, URLs, data transfer |
| Security? | ✅ Yes — designed for security | ✅ Yes — designed for integrity | ❌ No security — easily reversible |
A Digital Signature is the electronic equivalent of a handwritten signature. It proves: 1) Who sent the message (Authentication) and 2) The message was not altered (Integrity).
• Private Key → Signs (only the sender/owner can sign)
• Public Key → Verifies (anyone can verify the signature)
Sender creates a hash (SHA-256) of the original message or document.
Sender encrypts the hash using their own private key → this creates the “Digital Signature”.
Both the original message and the digital signature are sent to the receiver.
Receiver decrypts the signature using sender’s public key to get the original hash.
Receiver hashes the received message independently. If both hashes match → signature is valid → message is authentic and untampered.
| Security Goal | How Digital Signature Helps |
|---|---|
| Authentication | Proves message came from the genuine sender (only they have the private key) |
| Integrity | If message is altered, the hash won’t match — forgery detected |
| Non-Repudiation | Sender cannot later deny sending the message — legally enforceable |
• IT Act 2000, Section 5: Digital signatures are legally valid in India
• Section 3: Authentication of electronic records via digital signature
• Controller of Certifying Authorities (CCA) under MeitY regulates digital signature issuers in India
• Indian CAs licensed by CCA: NIC, e-Mudhra, CDAC, Capricorn, (n)Code
• Used in: GST filing, income tax returns, MCA filings, e-tender, Aadhaar eSign
A Digital Certificate is like an electronic ID card for a website or person. It proves that a public key truly belongs to a specific entity. Without certificates, anyone could impersonate a website — certificates prevent this “man-in-the-middle” attack.
📋 What a Digital Certificate Contains| Field | Description |
|---|---|
| Subject / Owner Name | Name of the website, person, or organization the certificate belongs to |
| Public Key | The owner’s public key (used for encryption or signature verification) |
| Issuer (CA Name) | Name of the Certificate Authority that issued and signed the certificate |
| Serial Number | Unique identifier for this certificate |
| Validity Period | Start date and expiry date (certificates must be renewed) |
| CA’s Digital Signature | CA’s own signature proving the certificate is genuine |
| Certificate Standard | Most certs follow X.509 standard (the global format) |
| Certificate Type | Purpose | Used In |
|---|---|---|
| SSL/TLS Certificate | Secures websites — enables HTTPS (lock icon 🔒) | All HTTPS websites |
| DV (Domain Validation) | Only domain ownership verified — basic level | Blogs, small websites |
| OV (Organization Validation) | Domain + Organization identity verified | Business websites |
| EV (Extended Validation) | Strictest verification — shows green bar/company name in old browsers | Banks, govt portals, e-commerce |
| Wildcard Certificate | Covers main domain + all subdomains (*.example.com) | Large websites with many subdomains |
| Code Signing Certificate | Verifies software publisher — proves software is not tampered | Windows apps, Android APKs |
| S/MIME Certificate | Secure email — sign and encrypt email messages | Corporate email systems |
| Client Certificate | Authenticates a user (not server) to a server | Corporate VPNs, smart cards |
Your browser sends: “Hello! I support TLS 1.3. Here are my supported cipher suites.”
Server responds: “Here is my digital certificate and public key.”
Browser checks: Is the certificate valid? Is it signed by a trusted CA? Has it expired or been revoked?
Browser and server use asymmetric encryption (RSA/ECC) to agree on a shared symmetric session key.
All data is now encrypted using the AES session key. The 🔒 lock icon appears in your browser.
PKI (Public Key Infrastructure) is the complete system — people, processes, software, and hardware — that manages the creation, distribution, storage, and revocation of digital certificates.
🧩 Key Components of PKI| Component | Full Form | Role |
|---|---|---|
| CA | Certificate Authority | Issues, signs, and manages digital certificates — the most trusted entity in PKI |
| Root CA | Root Certificate Authority | Top-level CA; self-signed; pre-installed in all browsers/OSes (e.g., DigiCert, GlobalSign, Comodo) |
| Intermediate CA | Subordinate / Intermediate CA | Issues certificates on behalf of Root CA; creates a trust chain |
| RA | Registration Authority | Verifies the identity of certificate applicants before CA issues the certificate |
| CRL | Certificate Revocation List | Published list of revoked (cancelled) certificates — browsers check this |
| OCSP | Online Certificate Status Protocol | Real-time, per-certificate revocation check — more efficient than downloading full CRL |
| Repository | Certificate Repository | Directory where certificates and CRLs are publicly stored |
(Self-signed, Pre-trusted)
(Signed by Root)
(Signed by Intermediate)
Website
• CCA is the apex authority for digital signatures in India (under MeitY, IT Act 2000)
• CCA licenses Certifying Authorities (CAs) in India
• Licensed Indian CAs: NIC-CA, e-Mudhra, SafeScrypt, CDAC, Capricorn, (n)Code Solutions, NSDL Database Management
• Used for: Income Tax e-filing, GST, MCA21, e-Procurement, DigiLocker documents
• eSign: Aadhaar-based digital signature — no USB token needed; OTP-based signing
| Term | Simple Definition |
|---|---|
| Plaintext | Original, readable data BEFORE encryption |
| Ciphertext | Scrambled, unreadable data AFTER encryption |
| Cipher | The encryption algorithm used (e.g., AES cipher) |
| Key | Secret parameter used by the cipher to encrypt/decrypt data |
| Digest / Hash | Fixed-length output of a hash function (digital fingerprint) |
| HMAC | Hash-based Message Authentication Code — hash + secret key = proves integrity AND authenticity |
| Certificate | Electronic document binding a public key to an identity, signed by a CA |
| X.509 | The international standard format for digital certificates |
| PEM / DER | File formats for certificates — PEM is base64 text (.pem, .crt), DER is binary (.der) |
| Handshake | The process by which client and server negotiate encryption settings and exchange keys |
| Session Key | Temporary symmetric key generated for a single communication session |
| Key Exchange | Process of securely sharing a symmetric key between two parties (Diffie-Hellman, RSA, ECDH) |
| Forward Secrecy (PFS) | Past session keys remain safe even if long-term key is compromised — uses ephemeral keys |
| Non-Repudiation | Sender cannot deny sending a message — provided by digital signatures |
| Public Key | Can be shared freely; used to encrypt data or verify signatures |
| Private Key | Must be kept secret; used to decrypt data or create digital signatures |
| Key Pair | Mathematically linked public + private key generated together |
| Checksum | Simple value used to detect errors in data (CRC); NOT for security |
| Collision Attack | Finding two different inputs that produce the same hash — fatal flaw for MD5 |
| Rainbow Table | Pre-computed database of password → hash mappings used to crack passwords |
| Brute Force | Trying all possible keys/passwords until correct one found |
| TLS | Transport Layer Security — secure protocol for internet communication (replaces SSL) |
| SSL | Secure Sockets Layer — older version of TLS (deprecated, but name still used informally) |
| HTTPS | HTTP over TLS — secure web browsing — Port 443 — shows 🔒 in browser |
| Post-Quantum Cryptography | New encryption algorithms resistant to quantum computers (NIST standardizing them) |
| End-to-End Encryption (E2EE) | Only sender and receiver can read messages — even the service provider cannot |
| Law / Initiative | Relevant to Encryption |
|---|---|
| IT Act 2000 — Section 3 | Authentication of electronic records using digital signatures — legally recognized in India |
| IT Act 2000 — Section 5 | Legal validity of digital signatures — equivalent to handwritten signature |
| IT Act 2000 — Section 84A | Central Government can prescribe encryption modes/methods for use in India |
| DPDPA 2023 | Mandates data protection measures — encryption is key tool for compliance |
| CERT-In Guidelines (2022) | Mandates encryption and secure communication for reporting cyber incidents |
| RBI Guidelines | Mandate AES-256 encryption for banking data; TLS for online transactions; tokenization for card data |
| UIDAI / Aadhaar | Uses AES-256 encryption for biometric data; 2048-bit RSA for secure authentication |
| DigiLocker | Uses 256-bit encryption to store government documents securely |
| eSign Framework | Aadhaar-based digital signature service — uses ECDSA or RSA + SHA-256; no hardware token needed |
| NeSL (National e-Governance Services Ltd) | Uses PKI and digital certificates for legal documentation |
- A. Confidentiality — ensuring only authorized parties can read the data
- B. Integrity — ensuring data is not altered
- C. Authentication — verifying sender identity
- D. Availability — ensuring systems are accessible
- A. RSA
- B. AES
- C. ECC
- D. Diffie-Hellman
- A. Private Key
- B. Public Key of the recipient
- C. Session Key
- D. Any key can be used
- A. It uses asymmetric keys
- B. It cannot encrypt large files
- C. Its 56-bit key is too short and can be cracked by brute force
- D. It was never widely used
- A. Only symmetric encryption (AES)
- B. Only asymmetric encryption (RSA)
- C. Hybrid — asymmetric for key exchange, symmetric for data
- D. Only hashing
- A. ECC is simpler to implement
- B. ECC uses symmetric keys
- C. ECC provides equivalent security with much smaller key sizes, consuming less power
- D. RSA is not supported on mobile devices
- A. SSL/TLS Protocol
- B. PGP Protocol
- C. Signal Protocol
- D. RSA-4096 Protocol
- A. AES algorithm with 256 rounds of encryption
- B. AES algorithm using a 256-bit key length
- C. AES encrypting 256 bytes at a time
- D. AES with 256 different cipher modes
- A. Hashing is reversible with the correct key
- B. Hashing is primarily used for confidentiality
- C. Hashing produces a fixed-length output regardless of input size
- D. Hashing requires a public and private key pair
- A. SHA-256
- B. MD5
- C. SHA-512
- D. SHA-3
- A. 128 bits
- B. 160 bits
- C. 256 bits
- D. 512 bits
- A. MD5
- B. SHA-1
- C. SHA-256
- D. bcrypt
- A. SHA-256
- B. MD5
- C. bcrypt
- D. AES-128
- A. Make passwords longer
- B. Speed up the hashing process
- C. Add randomness to prevent rainbow table attacks
- D. Encrypt the hash using AES
- A. Large inputs take much longer to hash
- B. A tiny change in input results in a completely different output hash
- C. Hashes cascade into longer values
- D. Multiple hashes can produce the same output
- A. Hash-based Message Authentication Code
- B. High-level Message Authentication Cipher
- C. Hashed Mandatory Asymmetric Code
- D. Hybrid Message Authentication Certificate
- A. Deterministic
- B. Collision-resistant
- C. Reversible
- D. Fixed output length
- A. Using a longer password
- B. Using MD5 instead of SHA-256
- C. Adding a unique salt before hashing each password
- D. Encrypting the password before hashing
- A. Confidentiality, Availability, Integrity
- B. Authentication, Integrity, Non-Repudiation
- C. Availability, Authentication, Encryption
- D. Confidentiality, Authentication, Encryption
- A. Recipient’s Public Key
- C. Sender’s Private Key
- D. A shared symmetric key
- A. Encrypt full message with private key
- B. Hash the message, then encrypt with public key
- C. Hash the message, then encrypt the hash with private key
- D. Encrypt message with symmetric key, then hash
- A. Data cannot be read by unauthorized users
- B. Data integrity is guaranteed
- C. The sender cannot deny having sent the signed document
- D. The message is encrypted from end-to-end
- A. Section 43
- B. Section 66F
- C. Section 5
- D. Section 69A
- A. Physical USB token with embedded certificate
- B. Aadhaar-based OTP authentication for digital signing
- C. Biometric fingerprint matching only
- D. Paper-based certificate issuance
- A. To encrypt all website traffic using AES
- B. To verify that a public key belongs to a specific identity (website/person)
- C. To store private keys securely
- D. To generate hash values for files
- A. ISPs (Internet Service Providers)
- B. Certificate Authorities (CAs)
- C. Operating System vendors
- D. Firewall manufacturers
- A. Private Key Interface
- B. Public Key Infrastructure
- C. Protected Key Index
- D. Public Key Internet
- A. Encrypting messages in transit
- B. Real-time checking of whether a digital certificate has been revoked
- C. Generating new key pairs
- D. Hashing passwords for storage
- A. A list of all valid certificates
- B. A list of certificates that have been revoked before their expiry date
- C. A list of all public keys
- D. A list of firewall rules
- A. FTP
- B. TLS (Transport Layer Security)
- C. IPSec
- D. SSH
- A. 21
- B. 25
- C. 80
- D. 443
- A. Issued by a trusted Root CA
- B. Signed by the same entity whose identity it certifies
- C. Always trusted by all web browsers
- D. More secure than CA-issued certificates
- A. PGP
- B. AES-256
- C. X.509
- D. PKCS#7 only
- A. CERT-In
- B. TRAI
- C. CCA (Controller of Certifying Authorities)
- D. RBI
- A. The website is government-approved
- C. The connection is encrypted using TLS and the certificate is valid
- D. The website has no viruses
- A. Future sessions are encrypted with stronger keys
- B. Past session keys remain secure even if the server’s long-term private key is later compromised
- C. Certificates never expire
- D. Hashes are reversible for debugging
- A. Base64 uses longer keys than AES
- B. Base64 is only used for images
- C. Base64 is reversible by anyone without any key — it provides NO security
- D. Base64 creates a fixed-length output like a hash
- A. DES-56
- B. RSA-1024
- C. AES-256
- D. MD5
- A. Blockchain
- B. Cloud Computing
- C. Quantum Computing
- D. 5G Networks
- A. DES-56
- B. MD5
- C. AES-256
- D. SHA-1
- A. Double Encryption
- B. Hybrid Encryption
- C. Layered Encryption
- D. Mixed Encryption
- A. MD5
- B. SHA-1 (being migrated to SHA-256)
- C. bcrypt
- D. AES
- A. The website is automatically renewed and stays secure
- C. Browsers show a “Not Secure” or certificate error warning
- D. The website gets a new certificate from the CA automatically
- A. Cyber terrorism
- B. Identity theft
- C. Central Government’s power to prescribe encryption modes and methods
- D. Blocking of websites
- A. Secure websites with HTTPS
- B. Verify that software/apps have not been tampered with and came from a legitimate publisher
- C. Encrypt email messages
- D. Authenticate users to servers
- A. Plain text
- B. MD5 hash
- C. AES encrypted
- D. Argon2 or bcrypt with unique salt per user
- A. Standard
- B. Secure
- C. Simple
- D. Signed
- A. DES-56
- B. MD5
- C. 256-bit encryption (AES-256)
- D. RSA-1024
- A. HTTPS website with TLS
- B. Email sent via Gmail without encryption
- C. WhatsApp messages encrypted using Signal Protocol
- D. FTP file transfer
- A. DES
- B. RC4
- C. AES (CCMP)
- D. RSA
- A. DV (Domain Validated) Certificate
- B. OV (Organization Validated) Certificate
- C. EV (Extended Validation) Certificate
- D. Self-signed Certificate
- A. Aadhaar alone
- B. PAN card
- C. Digital Signature Certificate (DSC) or eSign through the Income Tax Portal
- D. OTP only (no digital signature)
