Introduction to cryptography. Using Caesar cipher ,Vigenere cipher to help Phineas and Ferb hide their plan from Candace . And finally ,RSA encryption technique explained.
9. CAESAR CIPHER
p is the plaintext and ๐๐ is the i th character in p
and k is the secret key
Each letter ๐๐of the cipher text c is calculated as:
10. LETS GET AN ICECREAM
WV JHW DQ LFHFUHDPO H
CAESARCIPHER
11.
12. VIGENERE CIPHER
Each letter ๐๐of the cipher text c is calculated as:
p is the plaintext and ๐๐ is the i th character in p
and ๐๐ is the j th letter of the secret key.
16. Generation of RSA key pairs
โข Choose two prime numbers, p and q
p = 7 and q = 13
โข Calculate RSA modulus (n)
n = pq
n = 91
โข Find a number e such that 1<e<m and
gcd(e,m) = 1 where m = (p-1)(q-1)
let e = 5
17. โข Public key is of the form (n,e).
Thus the pair (91,5) form our public key.
โข Private key (d)
ed = 1 mod m
5d = 1 mod 72
โข Extended Euclidean Algorithm
ax + by = gcd(a,b)
5x + 72y = 1
5x = 1 โ 72y
5x = 1 mod 72
22. x y d k
1 0 5
0 1 72 0
1 0 5 14
-14 1 2 2
29 -2 1 2
23. โข Private key is the pair (91,29)
โข Message , p is โCSโ
c = ๐ ๐
๐๐๐ ๐
c1 = 58
c2 = 83
Cipher text c = 58 83
24. โข To Decrypt the message
p = ๐ ๐
mod n
p1 = 58 ^ 29 (mod 91)
p1 = 67 i.e C
p2 = 83 ^ 29 (mod 91)
p2 = 83
So the message is โCSโ
Editor's Notes
The growing understandability of number theory and algebra led to the advancement in ciphers or algorithms, it was adopted by govt, military business organizations to secure their secrets.Cryptography has decided wars and now is at the heart of communication
FREQUENCY ANALYSIS AND BRUTE FORCE ATTACKS
Pick 2 prime numbers.in practice this no are too big so that its harder to crack.p and q recommended to be 1024 bits i.e each no over 300 decimal digits.