RSA Cryptosystem with p=11 and q=7
RSA is an asymmetric encryption algorithm where the public key is used for encryption and the private key for decryption, based on the difficulty of factoring large prime numbers.
Given:
- p=11, q=7
Step A: Compute n and φ(n)
n=p×q=11×7=77
ϕ(n)=(p−1)(q−1)=10×6=60
i. Public Key Pair (e, n)
Choose e such that:
- 1<e<ϕ(n)
- gcd(e,ϕ(n))=1 (e must be coprime with 60)
Let's try e=7:
gcd(7,60)=1
Public Key = (e, n) = (7, 77)
ii. Private Key Pair (d, n)
Find d such that:
d×e≡1(modϕ(n))
d×7≡1(mod60)
We need to find multiplicative inverse of 7 mod 60.
Using Extended Euclidean Algorithm:
- 60=8×7+4
- 7=1×4+3
- 4=1×3+1
- 3=3×1+0
Back substitution:
- 1=4−1×3
- 1=4−1×(7−1×4)=2×4−1×7
- 1=2×(60−8×7)−1×7=2×60−17×7
So d=−17≡60−17=43(mod60)
Verification: 43×7=301=5×60+1≡1(mod60)
Private Key = (d, n) = (43, 77)
iii. Ciphertext for M = 6
Encryption formula:
C=Memodn
C=67mod77
Computing step by step:
- 61=6
- 62=36
- 64=362=1296mod77=1296−16×77=1296−1232=64
- 67=64×62×61=64×36×6
Now:
- 64×36=2304mod77=2304−29×77=2304−2233=71
- 71×6=426mod77=426−5×77=426−385=41
Ciphertext C = 41
Summary Table
| Parameter |
Value |
| n |
77 |
| φ(n) |
60 |
| Public Key (e, n) |
(7, 77) |
| Private Key (d, n) |
(43, 77) |
| Plaintext M |
6 |
| Ciphertext C |
41 |
Conclusion: RSA security relies on the difficulty of factoring n back into p and q. The public key encrypts the message, and only the holder of the private key can decrypt it.