Unit 2
🎯 Unit 2 Overview
Unit 2 covers advanced encryption and public key cryptography. In this unit, AES, Diffie-Hellman,
RSA, digital signatures, primality testing, elliptic curve cryptography and Chinese Remainder
Theorem are studied.
Exam Tip: AES, Diffie-Hellman Key Exchange, RSA Algorithm, RSA Signature and Chinese Remainder Theorem are very important for RGPV exams.
🔒 Advanced Encryption Standard (AES)
AES is a symmetric key block cipher used for secure data encryption. It replaced DES because DES
became weak due to its small key size.
Features of AES
- Symmetric key encryption algorithm
- Block size: 128 bits
- Key sizes: 128-bit, 192-bit and 256-bit
- More secure than DES
- Fast and widely used
| Key Size |
Number of Rounds |
| 128-bit |
10 rounds |
| 192-bit |
12 rounds |
| 256-bit |
14 rounds |
⚙️ AES Round Operations
AES performs multiple rounds of transformation on plaintext to generate ciphertext.
- SubBytes: Byte substitution using S-box.
- ShiftRows: Rows of state matrix are shifted.
- MixColumns: Columns are mixed for diffusion.
- AddRoundKey: Round key is XORed with state matrix.
Important: Final AES round does not include MixColumns operation.
🔑 Public Key Cryptosystem
Public key cryptosystem uses two keys: public key and private key. Public key is shared with everyone,
while private key is kept secret by the owner.
| Key |
Use |
| Public Key |
Used for encryption or signature verification |
| Private Key |
Used for decryption or digital signature generation |
Advantages
- Solves key distribution problem
- Supports digital signatures
- Provides authentication
- Useful for secure communication over internet
📌 Discrete Logarithmic Problem
The discrete logarithmic problem is a mathematical problem used in many public key cryptosystems.
It is easy to calculate powers modulo a number, but difficult to find the exponent.
Example: If gx mod p = y, finding x is called discrete logarithmic problem.
🤝 Diffie-Hellman Key Exchange
Diffie-Hellman is a key exchange algorithm used to securely share a secret key over an insecure channel.
Steps
- Alice and Bob agree on public values p and g.
- Alice chooses private key a and sends A = ga mod p.
- Bob chooses private key b and sends B = gb mod p.
- Alice calculates shared key K = Ba mod p.
- Bob calculates shared key K = Ab mod p.
- Both get the same secret key.
Advantages
- Secure key exchange
- No need to send secret key directly
- Used in secure communication protocols
⚠️ Computational & Decisional Diffie-Hellman Problem
| Problem |
Meaning |
| Computational Diffie-Hellman Problem |
Given g, ga and gb, finding gab is difficult. |
| Decisional Diffie-Hellman Problem |
Given g, ga, gb and gc, deciding whether c = ab is difficult. |
🔐 RSA Cryptosystem
RSA is a public key cryptosystem based on the difficulty of factorizing large prime numbers.
It is used for encryption, decryption and digital signatures.
RSA Key Generation Steps
- Choose two large prime numbers p and q.
- Calculate n = p × q.
- Calculate φ(n) = (p − 1)(q − 1).
- Choose public key e such that gcd(e, φ(n)) = 1.
- Calculate private key d such that d × e ≡ 1 mod φ(n).
- Public key = (e, n), Private key = (d, n).
Encryption and Decryption
Ciphertext: C = M^e mod n
Plaintext: M = C^d mod n
📄 RSA Assumptions
- Large prime factorization is computationally difficult.
- It is difficult to find private key from public key.
- Security depends on the size of prime numbers.
- Breaking RSA requires factoring n into p and q.
✍️ RSA Signature
RSA digital signature is used to verify authenticity and integrity of a message.
Process
- Sender creates hash of message.
- Sender encrypts hash using private key.
- This encrypted hash is the digital signature.
- Receiver decrypts signature using sender public key.
- Receiver compares received hash with calculated hash.
Digital signature provides authentication, integrity and non-repudiation.
🆔 Schnorr Identification Scheme
Schnorr identification is a cryptographic protocol used to prove identity without revealing the secret key.
Features
- Based on discrete logarithm problem
- Used for authentication
- Efficient and secure
- Does not reveal private key
🔎 Primality Testing
Primality testing is used to check whether a number is prime or not. Prime numbers are very important
in cryptography, especially RSA.
Common Methods
- Trial Division
- Fermat Primality Test
- Miller-Rabin Test
📈 Elliptic Curve Cryptography (ECC)
Elliptic Curve Cryptography is a public key cryptographic technique based on elliptic curves.
It provides strong security with smaller key sizes.
Elliptic Curve Equation
y² = x³ + ax + b
Advantages of ECC
- Smaller key size
- High security
- Faster computation
- Less memory requirement
- Useful in mobile and IoT devices
🧮 Elliptic Curve over Reals and Modulo Prime
| Type |
Description |
| Elliptic Curve over Reals |
Uses real numbers and is mainly used for understanding curve structure. |
| Elliptic Curve Modulo Prime |
Uses finite field modulo prime and is used in practical cryptography. |
🧩 Chinese Remainder Theorem
Chinese Remainder Theorem is used to solve simultaneous congruence equations.
It is also used in RSA to speed up computations.
Example Form
x ≡ a₁ mod m₁
x ≡ a₂ mod m₂
x ≡ a₃ mod m₃
Applications
- RSA optimization
- Modular arithmetic
- Cryptographic computations
- Number theory problems
⚖️ AES vs RSA
| AES |
RSA |
| Symmetric key algorithm |
Asymmetric key algorithm |
| Same key for encryption and decryption |
Public key and private key are different |
| Fast |
Slower than AES |
| Used for bulk data encryption |
Used for key exchange and digital signature |
⭐ Important Questions
- Explain AES algorithm and its round operations.
- Explain public key cryptosystem.
- Explain Diffie-Hellman Key Exchange algorithm.
- Explain Computational and Decisional Diffie-Hellman problem.
- Explain RSA algorithm with key generation steps.
- Explain RSA encryption and decryption.
- Explain RSA digital signature.
- Write short note on Schnorr Identification Scheme.
- Explain Elliptic Curve Cryptography.
- Explain Chinese Remainder Theorem and its applications.
🔥 Last Minute Revision
- AES = symmetric key block cipher.
- AES block size = 128 bits.
- AES key sizes = 128, 192, 256 bits.
- Public key cryptosystem uses public and private key.
- Diffie-Hellman is used for secure key exchange.
- RSA security depends on factorization difficulty.
- RSA public key = (e,n), private key = (d,n).
- ECC gives high security with smaller key size.
- CRT is used for solving congruences and RSA optimization.