Presentation is loading. Please wait.

Presentation is loading. Please wait.

Classical Cryptography 1. Introduction: Some Simple Cryptosystems.

Similar presentations


Presentation on theme: "Classical Cryptography 1. Introduction: Some Simple Cryptosystems."— Presentation transcript:

1 Classical Cryptography 1. Introduction: Some Simple Cryptosystems

2 p2. Outline [1] Introduction: Some Simple Cryptosystems The Shift Cipher The Substitution Cipher The Affine Cipher The Vigen è re Cipher The Hill Cipher The Permutation Cipher Stream Ciphers [2] Cryptanalysis Cryptanalysis of the Affine Cipher Cryptanalysis of the Substitution Cipher Cryptanalysis of the Vigen è re Cipher Cryptanalysis of the Hill Cipher Cryptanalysis of the LFSR Stream Cipher

3 p3. Introduction: Some Simple Cryptosystems [1] Introduction AliceencrypterdecrypterBob Oscar secure channel key source xx K y

4 p4. Introduction: Some Simple Cryptosystems Definition 1.1: A cryptosystem is a five-tuple ( P, C, K, E, D ) satisfies P is a finite set of possible plaintexts C is a finite set of possible ciphertexts K, the keyspace, is a finite set of possible keys For each K ∈ K, there is an encryption rule e K ∈ E and a corresponding decryption rule d K ∈ D d K (e K (x))=x for every plaintext x ∈ P

5 p5. Introduction: Some Simple Cryptosystems Definition 1.2: a and b are integers, m is a positive integer congruence: a ≡ b (mod m) if m divides b-a Z m : the set {0,1,…,m-1} with 2 operations + and ☓ 10+20=4 in Z 26 (10+20 mod 26=4) 10 ☓ 20=18 in Z 26 (10 ☓ 20 mod 26=18)

6 p6. Introduction: Some Simple Cryptosystems Shift Cipher Cryptosystem 1.1: Shift Cipher P = C = K = Z 26 K, x, y ∈ Z 26 e K (x)=(x+K) mod 26 d K (y)=(y-K) mod 26 ABCDEFGHIJKLM 0123456789101112 NOPQRSTUVWXYZ 13141516171819202122232425

7 p7. Introduction: Some Simple Cryptosystems eg.: Suppose K=11 Plaintext: student Ciphertext: DEFOPZE plaintext student 181920341319 +K3451415254 ciphertextDEFOPZE

8 p8. Introduction: Some Simple Cryptosystems Substitution Cipher Cryptosystem 1.2: Substitution Cipher P=C=Z 26 K: all possible permutations of the 26 symbols For each  ∈ K e  (x)=  (x) d  (y)=  -1 (y) where  -1 is the inverse permutation to 

9 p9. Introduction: Some Simple Cryptosystems eg.: Plaintext: student Ciphertext: VMUSHSM xabCdefghijklm e  (x)XNYAHPOGZQWBT xnopqrstuvwxyz SFLRCVMUEKJDI

10 p10. Introduction: Some Simple Cryptosystems Affine Cipher Theorem 1.1: ax ≡ b (mod m) has a unique solution x ∈ Z m for every b ∈ Z m iff gcd(a,m)=1 Definition 1.3: Suppose a≥1 and m≥2 are integers a and m are relatively prime if gcd(a,m)=1  (m): the number of integers in Z m that are relatively prime to m Theorem 1.2: Suppose

11 p11. Introduction: Some Simple Cryptosystems Definition 1.4: Suppose a ∈ Z m a -1 mod m: the multiplicative inverse of a modulo m aa -1 ≡ a -1 a ≡ 1 (mod m) Cryptosystem 1.3: Affine Cipher P = C = Z 26 K ={(a,b) ∈ Z 26 ☓ Z 26 : gcd(a,26)=1} For K=(a,b) ∈ K ; x, y ∈ Z 26 e K (x)=(ax+b) mod 26 d K (y)=a -1 (y-b) mod 26

12 p12. Introduction: Some Simple Cryptosystems e.g.: Suppose K=(7,3) 7 -1 mod 26 = 15 Plaintext: student Ciphertext: ZGNYFQG e K (x)=(7x+3) mod 26 d K (y)=15(y-3) mod 26 plaintext student 181920341319 e K (x)25613245166 ciphertextZGNYFQG

13 p13. Introduction: Some Simple Cryptosystems Vigenère Cipher Cryptosystem 1.4: Vigenère Cipher m: a positive integer P = C = K = (Z 26 ) m For a key K=(k 1,k 2, …,k m ) e K (x 1,x 2, …,x m )=(x 1 +k 1,x 2 +k 2, …,x m +k m ) d K (y 1,y 2, …,y m )=(y 1 -k 1,y 2 -k 2, …,y m -k m )

14 p14. Introduction: Some Simple Cryptosystems e.g.: Suppose m=4 and K=(2,8,15,7) Plaintext: student Ciphertext: UBJKGVI plaintext student 181920341319 +K2815728 ciphertext2019106218

15 p15. Introduction: Some Simple Cryptosystems Hill Cipher Definition 1.5: Suppose A=(a i,j ) is an m ☓ m matrix A i,j : the matrix obtained from A by deleting the ith row and the jth column det A: the determinant of A m=1: det A=a 1,1 m>1: for any fixed i A * =(a * i,j ): the adjoint matrix of A a * i,j =(-1) i+j det A j,i

16 p16. Introduction: Some Simple Cryptosystems Theorem 1.3: Suppose K=(k i,j ) is an m ☓ m invertible matrix over Zn K -1 =(det K) -1 K * e.g.: det K=11 ☓ 7-8 ☓ 3 mod 26=1 K- 1 =(det K) -1 K * =

17 p17. Introduction: Some Simple Cryptosystems Cryptosystem 1.5: Hill Cipher M ≥ 2 is an integer P = C = (Z 26 ) m K = {m ☓ m invertible matrices over Z 26 } For a key K e K (x)=xK d K (y)=yK -1 where K -1 is the inverse of K

18 p18. Introduction: Some Simple Cryptosystems e.g.: Plaintext: GOD (6 14 3) Ciphertext: WTJ (22 19 9)

19 p19. Introduction: Some Simple Cryptosystems Permutation Cipher Cryptosystem 1.6: Permutation Cipher m is a positive integer P = C = (Z 26 ) m K consist of all permutations of {1, …,m} For a key(a permutation)  e  (x 1, …,x m )=(x  (1), …,x  (m) ) where  -1 is the inverse permutation to 

20 p20. Introduction: Some Simple Cryptosystems e.g.: Suppose m=6 Plaintext: CYBERFORMULA Ciphertext: BRCFEYMLOAUR x123456  (x) 351642 plaintextCYBERFORMULA ciphertextBRCFEYMLOAUR

21 p21. Introduction: Some Simple Cryptosystems Stream Ciphers Block ciphers Plaintext string x =x 1 x 2 … (each x i is a plaintext) Ciphertext string y =y 1 y 2 … = e K (x 1 )e K (x 2 ) … Stream ciphers Plaintext string x =x 1 x 2 … Generate a keystream (by using some K) z =z 1 z 2 … Ciphertext string y =y 1 y 2 … = e z1 (x 1 )e z2 (x 2 ) …

22 p22. Introduction: Some Simple Cryptosystems Definition 1.6: A synchronous stream cipher is a tuple ( P, C, K, L, E, D ) with a function g P : a finite set of possible plaintexts C : a finite set of possible ciphertexts K : a finite set of possible keys L : a finite set called the keystream alphabet g: the keystream generator Input: K g generates an infinite string z 1 z 2 …

23 p23. Introduction: Some Simple Cryptosystems Definition 1.6 (cont.) For each z ∈ L, there is an encryption rule e z ∈ E and a corresponding decryption rule d Z ∈ D d z (e z (x))=x for every plaintext x ∈ P

24 p24. Introduction: Some Simple Cryptosystems Vigenère Cipher can be defined as a synchronous stream cipher K = (Z 26 ) m P = C = L = Z 26 e z (x)=(x+z) mod 26 d z (y)=(y-z) mod 26 Keystream z 1 z 2 … = k 1 k 2..k m k 1 k 2..k m k 1 k 2..k m …

25 p25. Introduction: Some Simple Cryptosystems Keystream can be produced efficiently in hardware using a LFSR (Linear Feedback Shift Register) k 1 would be tapped as the next keystream bet k 2, … k m would each be shifted 1 stage to the left The new value of km would be this is “ linear feedback “ (see Figure 1.2) This system is modulo 2

26 p26. Introduction: Some Simple Cryptosystems e.g.: in Figure 1.2,suppose K=(1,0,0,0) c 0 =1, c 1 =1, c 2 =0, c 3 =0 The keystream is 100010011010111 … k1k1 k2k2 k3k3 k4k4 + Figure 1.2

27 p27. Introduction: Some Simple Cryptosystems Non-synchronous stream cipher: Each keystream element zi depends on previous plaintext or ciphertext elements Cryptosystem 1.7: Autokey Cipher P = C = K = L = Z 26 z 1 =K, z i =x i-1 for all i>1 For x, y, z ∈ Z 26 e z (x)=(x+z) mod 26 d z (y)=(y-z) mod 26

28 p28. Introduction: Some Simple Cryptosystems e.g.: Suppose K=8 Plaintext: student Ciphertext: ALNXHRG plaintext student 181920341319 keystream81819203413 ciphertext 01113237176 ALNXHRG


Download ppt "Classical Cryptography 1. Introduction: Some Simple Cryptosystems."

Similar presentations


Ads by Google