Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 2 Classical Cipher System SIMPLE SUBSTITUTION CIPHERS By: NOOR DHIA AL- SHAKARCHY 2012-2013.

Similar presentations


Presentation on theme: "Lecture 2 Classical Cipher System SIMPLE SUBSTITUTION CIPHERS By: NOOR DHIA AL- SHAKARCHY 2012-2013."— Presentation transcript:

1 Lecture 2 Classical Cipher System SIMPLE SUBSTITUTION CIPHERS By: NOOR DHIA AL- SHAKARCHY 2012-2013

2 2- SIMPLE SUBSTITUTION CIPHERS: In simple substitution (or mono alphabetic) ciphers, each character of the plaintext replaced with a corresponding character of ciphertext. A single one-to-one mapping function (f) from plaintext to ciphertext character is used to encrypt the entire message using the same key (k); such that: Ek(M) = F(m1) F(m2) …..F(mN) =C Where: N : is the length of the message. M : is plaintext message given by M = ( m1, m2, …..,mN). C : is ciphertext message given by C = (c1,c2,….., cN). There are many types of simple substitution ciphers according to its equations used to encryption, they: Shifted alphabet (Caesar cipher): F(a) = (a + k) mod n Where k : is the number of positions to be shifted. a : is a single character of the alphabet> n : is the size of the alphabet.

3 2- SIMPLE SUBSTITUTION CIPHERS: Example: If k =3 then we can encrypt the following message as: M = R E N A I S S A N C E Ek(M) = U H Q D L V V D Q F H Multiplication based (decimation): F(a) = ak mod n Where k, n are relatively prime in order to produce a complete set of residues. Example: If k =9 then the above message can encrypted as: M = R E N A I S S A N C E Ek(M) = X K N A U G G A N S K If k and n are not relatively prime, several letters will encipher to the same ciphertext letter, and not all letters will appear in the ciphertext.

4 2 - SIMPLE SUBSTITUTION CIPHERS: Addition and multiplication (affine): F(a) = (ak1+k0) mod n Where k1 and n are relatively prime Simple substitution ciphers dose not hide the underlying frequencies of the different letters of the plaintext, and hence it can be easily broken. Example: Encrypt the following message using Caesar and decimation methods of simple substitution Ciphers when k=13 and alphabet A … Z: M = RENAISSANCE First we give the position of each character in alphabet. A -0G -6M – 12S – 18Y -24 B -1 H -7N - 13T - 19Z -25 C -2I -8O - 14U -20 D -3J -9 P - 15V – 21 E -4K -10Q -16W - 22 F -5L - 11R -17X - 23 Then we obtained the equation with k =13 and n =26: Shifted alphabet (Caesar): F (a) = (a+k) mod n F (R) = (17 + 13) mod 26 = 30 mod 26 = 4 =E F (E) = (4 + 13) mod 26 = 17 mod 26 =17 = R F (N) = (13 +13) mod 26 = 26 mod 26 =0 =A And so on

5 2 - SIMPLE SUBSTITUTION CIPHERS: Multiplication based (decimation): We can't encrypted because k and n are not relatively prime (GCD (13, 26) =13 not 1) That’s mean: F (A) = 0 * 13 mod 26 = 0 = A F(C) = 2 * 13 mod 26 = 0 = A F (E) = 4 * 13 mod 26 = 0 = A This is meaning the characters A, C and E encrypted to same letter A.

6 3- HOMOPHONIC SUBSTITUTION CIPHERS: A homophonic substitution cipher maps each character a of the plaintext alphabet in to a set of Ciphertext elements f(a) called homophonies. High- order homophones: Example: Let n=5, alphabet= {E, I, L,M,S}, M= SMILE, X= K= LIMES. Find C. EILMS E1022180211 I1201250520 L1906231307 M0316082415 S1708211404 Matrix=5*5= 25 numbers= 01,……,25. C= 21 16 05 19 11

7 4-POLYALPHABETIC SUBSTITUTION CIPHERS: Vigener cipher : The key is specified by a sequence of the letters= k1,k2,……..,kd, where ki (i=1,2,….,d) gives the amount of shift in the ith alphabet that is: F(a) = (a + ki) mod n Where ki : is the number of positions to be shifted in the ith alphabet. a : is a single character of the alphabet. n : is the size of the alphabet. Example: we can encrypt the following message and key as: M = R E N A I S S A N C E K = B A N D B A N D B A N Ek(M) = S E A D J S F D O C R

8 4-POLYALPHABETIC SUBSTITUTION CIPHERS: Beaufort cipher : This cipher similar to Vigener cipher,where, The key is specified by a sequence of the letters, K=k1,k2,……..,kd, where ki(i=1,2,….,d) gives the amount of shift in the ith alphabet except the shifted is begin with 25in it's table that is: F(a) = (k i -a i ) mod n Where ki : is the number of positions to be shifted in the ith alphabet. a : is a single character of the alphabet. n : is the size of the alphabet. Example: we can encrypt the following message and key as: M = R E N A I S S A N C E K = B A N D B A N D B A N Ek(M) =

9 4-POLYALPHABETIC SUBSTITUTION CIPHERS: Variant Beaufort cipher : This cipher is the reversal of vigener cipher, and when used one to encryption the other is used to decryption and vice versa. Such that is: F(a i ) = (a i -k i ) mod n Where ki : is the number of positions to be shifted in the ith alphabet. a : is a single character of the alphabet. n : is the size of the alphabet. Example: we can encrypt the following message and key as: M = R E N A I S S A N C E K = B A N D B A N D B A N Ek(M) =

10 plaintext key ABCDEFGHIJKLMNOPQRSTUVWXYZ BCDEFGHIJKLMNOPQRSTUVWXYZA CDEFGHIJKLMNOPQRSTUVWXYZAB DEFGHIJKLMNOPQRSTUVWXYZABC EFGHIJKLMNOPQRSTUVWXYZABCD FGHIJKLMNOPQRSTUVWXYZABCDE GHIJKLMNOPQRSTUVWXYZABCDEF HIJKLMNOPQRSTUVWXYZABCDEFG IJKLMNOPQRSTUVWXYZABCDEFGH JKLMNOPQRSTUVWXYZABCDEFGHI KLMNOPQRSTUVWXYZABCDEFGHIJ LMNOPQRSTUVWXYZABCDEFGHIJK MNOPQRSTUVWXYZABCDEFGHIJKL NOPQRSTUVWXYZABCDEFGHIJKLM OPQRSTUVWXYZABCDEFGHIJKLMN PQRSTUVWXYZABCDEFGHIJKLMNO QRSTUVWXYZABCDEFGHIJKLMNOP RSTUVWXYZABCDEFGHIJKLMNOPQ STUVWXYZABCDEFGHIJKLMNOPQR TUVWXYZABCDEFGHIJKLMNOPQRS UVWXYZABCDEFGHIJKLMNOPQRST VWXYZABCDEFGHIJKLMNOPQRSTU WXYZABCDEFGHIJKLMNOPQRSTUV XYZABCDEFGHIJKLMNOPQRSTUVW YZABCDEFGHIJKLMNOPQRSTUVWX ZABCDEFGHIJKLMNOPQRSTUVWXY


Download ppt "Lecture 2 Classical Cipher System SIMPLE SUBSTITUTION CIPHERS By: NOOR DHIA AL- SHAKARCHY 2012-2013."

Similar presentations


Ads by Google