Download presentation
Presentation is loading. Please wait.
Published byHadian Irwan Rachman Modified over 5 years ago
1
The Caesar cipher Plain: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Cipher key: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C Key = 4 Plain: meet me after the toga Cipher: PHHW PH DIWHU WHK WRJD
2
The Caesar cipher for a key K=3, plaintext letter: ABCDEF...UVWXYZ ciphtertext letter: DEF...UVWXYZABC Hence TREATY IMPOSSIBLE is translated into WUHDWB LPSRVVLEOH
3
Substitution Cipher For each letter, substitute some other letter(randomly) A key determines what the substitution is E.g., 4, 8, 1, 26,... 1st letter in the alphabet will be represented by the 4th letter A D 2nd letter will be represented by the 8th B H 3rd letter will be represented by the 1st C A 4th letter will be represented by the 26th D Z
4
Shift cipher Two basic properties for a cryptosystem:
1. Each encryption function eK and each decryption dK should be efficiently computable. 2. An opponent upon seeing a ciphertext string y, should be unable to determine the key K that was used, or the plaintext string x. Question: is shift cipher secure? Of course NOT, since there are only 26 possible keys, it is easy to be broken by exhaustive key search. Example: JBCRCLQRWCRVNBJENBWRWN Plaintext: astitchintimesavesnine (K=9) On average, a plaintext will be computed after trying 26/2=13 times.
5
Shift Alphabets Cipher (direct)
C(a)=(a+k)mod n=26 encipher P=(c‐k)mod n=26 decipher i.e. c=(p+k)mod 26, where a =0,…………..z=25
6
Shift Alphabets Cipher (direct)
Ex : Encrypt the Plain text = THIS with key =3 T= H= I=8 S=18 Ek(T) = (T+KEY ) mod 26 = (19 + 3) mod 25 = 22 mod 26 =22 W Ek(H) =(H+KEY ) mod 26 = (7 + 3) mod 25 =10 mod 26 =10 K Ek(I) = (I+KEY ) mod 26 = (8 + 3) mod 25 = 11 mod 26 =11 L Ek(S) =(S+KEY ) mod 26 = (18 + 3) mod 25 = 21 mod 26 =22 V
7
Shift Alphabets Cipher (direct)
Ex : Decrypt cipher text = WKLV with key =3 DK(W) =(W-KEY) mod 26 = (22-3) mod 26 = 19 mod 26 = 19 T DK(K) =(K-KEY) mod 26 = (10-3) mod 26 = 7 mod 26 = 7 H DK(L) =(L-KEY) mod 26 = (11 - 3) mod 26 = 11 mod 26 =19 I DK(V) =(V-KEY) mod 26 = (21-3) mod 26 = 21 mod 26 = 21 S Plain text = THIS
8
Shift Alphabets Cipher (direct)
9
Standard-Reverse In this method, the shifting is toward the left side, so use the following form:- For Ciphering C=(K-P) mod 26 For Deciphering P=(K-C) mod 2
10
Standard-Reverse
11
Standard-Reverse Encryption
12
Standard-Reverse Decryption
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.