The Encryption and Decryption Process
The Encryption and Decryption Process
Plain Text (P)Original Readable Data
➔
Encryption AlgorithmLocks Data with Key (K)
➔
Cipher Text (C)Sent Over Untrusted Internet
➔
Decryption AlgorithmUnlocks Data with Key (K)
➔
Plain Text (P)Original Data Restored
Explanation
- The sender and receiver share a secret for symmetric encryption.
- A receiver with the correct key can reverse the transformation.
Two Types of Symmetric Ciphers
Two Types of Symmetric Ciphers
⚡ 1. Stream Ciphers
• Encrypts data 1 bit or 1 byte at a time continuously
• Very fast and uses minimal memory
• Best for live audio/video streaming & mobile calls
• Examples: RC4, ChaCha20, Vernam Cipher
🧱 2. Block Ciphers
• Breaks data into fixed-size blocks (e.g., 64-bit or 128-bit) and encrypts one block at a time
• Highly secure and widely used for files, databases & HTTPS
• Examples: DES (64-bit), 3DES, AES (128-bit), Blowfish
Explanation
- A block cipher transforms fixed-size groups of bits.
- A stream cipher combines the data with a sequence generated from a secret key.
DES Algorithm Specifications at a Glance
DES Algorithm Specifications at a Glance
📦 Block Size: 64 Bits
Takes 64 bits of Plain Text and outputs 64 bits of Cipher Text
🔑 Key Size: 56 Bits
Input key is 64 bits, but 8 bits are parity bits = 56-bit effective key
🔄 Rounds: 16 Rounds
Runs 16 identical Feistel rounds using 16 48-bit subkeys
🧩 S-Boxes: 8 S-Boxes
Each S-Box shrinks 6 bits into 4 bits (48 bits ➔ 32 bits)
Explanation
- DES processes a 64-bit block with 56 effective key bits.
- Its short key makes it a historical teaching example.
Step-by-Step Architecture of DES Encryption
Step-by-Step Architecture of DES Encryption
INPUT64-Bit Plain Text Block
Raw 64-bit input block
STEP 1Initial Permutation (IP)
Rearranges the 64 bits and splits into L0 (32-bit) & R0 (32-bit)
STEP 216 Identical Feistel Rounds
Each Round (1 to 16) uses a unique 48-bit Subkey (K1 to K16)
STEP 332-Bit Swap
Left (L16) and Right (R16) halves are swapped after Round 16
STEP 4Final Permutation (IP⁻¹)
Inverse Initial Permutation produces 64-Bit Cipher Text
Explanation
- DES divides the block into halves and processes them through successive Feistel rounds.
- The round keys change while the same round structure repeats.
The 4 × 4 Byte "State Matrix"
State Matrix (4 × 4 Bytes): | b0 b4 b8 b12 | | b1 b5 b9 b13 | | b2 b6 b10 b14 | | b3 b7 b11 b15 |
Explanation
- Sixteen bytes of input fill four columns of the AES state.
- The round operations change this same array of bytes.
The 4 Transformations Inside an AES Round
The 4 Transformations Inside an AES Round
1. SubBytesByte-by-Byte S-Box Substitution
➔
2. ShiftRowsCyclically Shift Rows Left
➔
3. MixColumnsMatrix Math on Each Column
➔
4. AddRoundKeyXOR with 128-bit Round Key
Explanation
- An ordinary AES round substitutes bytes, shifts rows, mixes columns and adds a round key.
- The final round omits the column mixing step.
Evolution of Asymmetric (Public-Key) Cryptography
Evolution of Asymmetric (Public-Key) Cryptography
1970–1973GCHQ (Classified British Intelligence)
James Ellis, Clifford Cocks & Malcolm Williamson secretly conceived non-secret encryption (kept classified until 1997)
1976Diffie-Hellman Revolution ("New Directions in Cryptography")
Whitfield Diffie & Martin Hellman (with Ralph Merkle) publicly invented Public-Key Cryptography & Key Exchange
1977Invention of RSA Algorithm at MIT
Ron Rivest, Adi Shamir & Leonard Adleman created the first practical Public-Key encryption & digital signature system
1985–PresentElliptic Curve Cryptography (ECC) & Modern Web
Neal Koblitz & Victor Miller introduced ECC, enabling fast public-key security on smartphones and HTTPS
Explanation
- Public-key methods let participants publish one key and protect its partner.
- Different schemes support different tasks, such as key agreement or encryption.
Asymmetric Encryption Workflow (Confidentiality)
Asymmetric Encryption Workflow (Confidentiality)
1. Key GenerationPriya generates Public Key (PU_b) & Private Key (PR_b)
➔
2. EncryptionRahul locks Plain Text using Priya's PUBLIC Key (PU_b)
➔
3. TransmissionCipher Text travels safely over public internet
➔
4. DecryptionPriya unlocks Cipher Text using her PRIVATE Key (PR_b)
Explanation
- The sender encrypts for the recipient using the recipient's public key.
- The recipient uses the matching private key to recover the message.
Complete 5-Step RSA Key Generation & Encryption Flow
Complete 5-Step RSA Key Generation & Encryption Flow
STEP 1Choose Two Distinct Prime Numbers (p and q)
Keep p and q secret (e.g., p = 3, q = 11)
STEP 2Calculate Modulus n = p × q
n is used in both Public and Private keys
STEP 3Calculate Euler's Totient φ(n) = (p − 1) × (q − 1)
Keep φ(n) strictly secret
STEP 4Choose Public Exponent e
1 < e < φ(n) such that gcd(e, φ(n)) = 1 (co-prime)
STEP 5Compute Private Exponent d
(d × e) mod φ(n) = 1
Explanation
- Two primes determine the modulus used by both RSA keys.
- The public and private exponents are mathematically related so the classroom operation can be reversed.