Network Security - asymmetric key encryption
1. Asymmetric Key Encryption
Definition:
Asymmetric encryption uses two keys:
-
Public key: Known to everyone, used for encryption
-
Private key: Kept secret, used for decryption
Key points:
-
Eliminates the need to share secret keys over insecure channels.
-
Slower than symmetric encryption, often used to exchange symmetric keys.
-
Enables digital signatures for authentication and integrity.
2. RSA (Rivest–Shamir–Adleman)
-
Developed: 1977
-
Type: Public-key cryptosystem
-
Based on: Difficulty of factoring large prime numbers
How it works (simplified):
-
Generate two large prime numbers pp and qq
-
Compute n=p×qn = p \times q (used as modulus)
-
Calculate ϕ(n)=(p−1)(q−1)\phi(n) = (p-1)(q-1)
-
Choose a public key exponent ee (1 < e < φ(n), gcd(e, φ(n)) = 1)
-
Compute private key dd such that d×e≡1 (mod ϕ(n))d \times e \equiv 1 \ (\text{mod } \phi(n))
Encryption: C=Memod nC = M^e \mod n
Decryption: M=Cdmod nM = C^d \mod n
Pros:
-
Well-studied and widely used
-
Supports both encryption and digital signatures
Cons:
-
Requires large key sizes (2048+ bits) for strong security
-
Slower than symmetric algorithms
3. ECC (Elliptic Curve Cryptography)
-
Developed: 1985 (by Victor Miller and Neal Koblitz)
-
Type: Public-key cryptosystem
-
Based on: Elliptic curve discrete logarithm problem (ECDLP)
How it works (simplified):
-
Choose an elliptic curve y2=x3+ax+by^2 = x^3 + ax + b over a finite field
-
Select a base point GG on the curve
-
Private key dd is a random number
-
Public key Q=d⋅GQ = d \cdot G (scalar multiplication on the curve)
Encryption and signature:
-
Uses operations on points of the elliptic curve
-
Provides same security as RSA with much smaller key sizes
Pros:
-
Smaller keys → faster computation and less storage
-
Efficient for mobile and IoT devices
-
Strong security with 256-bit key comparable to 3072-bit RSA
Cons:
-
More complex mathematics than RSA
-
Patent issues in early years (mostly expired now)
Comparison: RSA vs ECC
Feature | RSA | ECC |
---|---|---|
Key size | 2048+ bits | 256 bits (equivalent) |
Security | Factoring large numbers | Elliptic curve discrete log |
Speed | Slower | Faster |
Efficiency | More storage & bandwidth | Less storage & bandwidth |
Common use | General encryption, digital signatures | Mobile, IoT, secure communication |