Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
In the Substitution Technique, The characters of the Plain Text message are replaced by others Characters by using any algorithm to create the Cipher Text. These Characters can be any of three: - Alphabets, Numbers or Symbols. Various Substitution Cipher Technique are given following. 1 2 3 4 5 6 Casear Cipher Mono-alphabetic Cipher Poly-alphabetic cipher Homophonic Cipher Polygram Cipher Polyfair Cipher
Replacement Table for Encryption Here Characters shifts by key of 3, so it is also called as Shift Cipher. In a Modified version of Caesar cipher Key can be any number from 1 to 25 because we know the English alphabet have the 26 alphabets only. So 26th shift is comes remain same as Plain Text. Due to this there are total 25 possibilities are comes out for encryption.
Example
Example for Encrypt the Massage A B C D D E F G F G H I J K J K M N M N P Q P Q R S T S T U V W W X Z A Z C
Example for Decrypt the Massage (Simply Change the Row of Replacement Table for Decryption) D E F G A B C D I J K F G H M N J K P Q M N S T U V W P Q R S T Z A W X C Z
Note: Cryptanalyst is a unknown person who want to break a cipher text to obtain the original Plain text massage by illegal authority. And the process is called as cryptanalysis.
2. Mono-alphabetic Cipher
As we know there is only 25 Possible keys present in Caesar Cipher. Thus any cryptanalyst has the ability to get original massage by 25 possible attacks and he is assured of success. Due to the Major weakness in Caesar Cipher, we are decided to use Random substitution. In Mono-alphabetic Cipher, a Character (or a symbol) in plaintext is always changed to the Specified character to create the Cipher text. Keep in mind the positions of character are not changed, only substitute the desired character. There exists one-to-one relationship.
For example if the Algorithm says the Character A in the plaintext changed to D. then every character A should be changed to character D. This means that Each A can be replaced by any other alphabet (B to Z). & Each B can be replaced by any other alphabet (A or C to Z) and so on.
Plain Text H E L L O Cipher Text Here Both occurrence of Ls are encrypted by Os so it is Mono-alphabetic Cipher. To put it mathematically We have total possibilities 26! = (26x25x24x23x..x1) = 403291461126605635584000000 (27 digits) . This is extremely hard to crack. Thus a Mono-alphabetic cipher creates a difficult problem for a cryptanalyst to break the code. Because it is impossible to check all the possibilities.
3. Poly-alphabetic Cipher
Invented in 1568. In Poly-alphabetic Cipher, each character can have a different substitute. This Cipher uses multiple one-character keys. So there exists one-to-Many relationship. Each of key encrypts one plain text character. i.e. the first key encrypt the first character, Second key encrypts the second character and so on. Main Features A) It uses a set of related mono-alphabetic substitution rules.
B) And a key that determines which rule is used for which transformation. - To understand this technique, we need to look a table which is formally known Vigenere table. A) There is a table of 26 Row x 27 Column. B) 1st column is used for the key for 1st character, 2nd character, Plain Text H E L and 3rd character of Plain text and so on. C) Now start with 1st Row and 2nd column. Key Example for understand Cipher Text Position of Character 1st char. of MSG. 2 char. of MSG. 3 char. of MSG. 4 char. of MSG. 5 char. of MSG.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
th th rd nd
L O
Corresponding Char. of Cipher Text Corr. Char of H & O ------V Corr. Char of E & F -------I Corr. Char of L & A -------J Corr. Char of L & B -------J Corr. Char of O & K ------U A A A A A A A A A B C D E F G H I J K L B C D E F G H I J K L M B C D E F G H I J K L B C D E F G H I J K L B C D E F G H I J K L B C D E F G H I J K L B C D E F G H I J K L B C D E F G H I J K L M
H from 1 Row E from 2nd Row L from 3rd Row L from 4th Row O from 5th Row
st
O from 1 column F from 1st column A from 1st column B from 1st column K from 1st column
st
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
A A A A A A A A A A A A A A A A B B C B C D B C D E B C D E F B C D E F G B C D E F G H B C D E F G H I B C D E F G H I J B C D E F G H I J K B C D E F G H I J K L B C D E F G H I J K L B C D E F G H I J K L B C D E F G H I J K L B C D E F G H I J K L
B C D E F G H I J K L
M N O P Q R S T U V W
M N O P Q R S T U V
M N O P Q R S T U V
M N O P Q R S T U V
M N N O P Q R S T O P Q R S T U
M N O P Q R S
M N O P Q R
M N O P Q
M N O P
M N O
W X Y
M N
W X
But in case of Homophonic substitution Cipher, one alphabet of plain text can map more than one alphabet of cipher text. Example- A can be replace by D, H, P, R etc. B can be replace by E, I, Q, S etc. as per given specifications.
STEP 1: Creation and population of matrix - Playfair cipher use of 5x5 matrix, which is used to store the keyword. - That becomes the key for Encryption & Decryption. - Enter the keyword in the matrix Row-wise: left to right, and then top-to-bottom. - Ignore the same characters. - Fill the remaining spaces in the matrix with the rest of the English alphabets (A-Z), if I or J is the part of our keyword, disregard both the I and J while filling the remaining slots. For Example P L A Y F Suppose given keyword is PLAYFAIR EXAMPLE. I R E X M Rewrite the keyword ignoring same character PLAYF IREXM. Put these latters B C D G H in 5x5 matrix. K N O Q S Now fill remaining spaces with A-Z without repeating words. T U V W X
STEP 2: Encryption Process - 1). The Plaintext that we want to encrypt needs to be broken down in to groups of two alphabets. For example if our plaintext is MY NAME IS ATUL, it becomes MY NA ME IS AT UL. - 2). If both the alphabets are same (or only one is left in last), add an X after first alphabet. - 3). If both the alphabets in the pair appear in same row of matrix, replace them with alphabets to their immediate right respectively. - 4). If both the alphabets in the pair appear in same column of our matrix, replace them with alphabets to their below them respectively. - 5). If the alphabets are not in same row or column, replace them with alphabets in the same row respectively. But at the other pair of corners of the rectangle defined by the original pair. The first encrypted alphabet of the pair is one that is present in the same row of first plaintext alphabet. For Example Suppose given keyword is PLAYFAIR EXAMPLE. And original massage is MY NAME IS ATUL 1. Break original massage in to two alphabets. MY NAME IS ATUL----------- MY NA ME IS AT UL
2. Now use the 5x5 matrix of keyword PLAYFAIR EXAMPLE. In above step our 1 st pair of alphabets is MY. Looking in matrix, alphabet M & Y do not occur in the same row or column. Now we need to apply step 5. Now first encrypted pair for MY is XF
P L A Y F I R E X M B C D G H K N O Q S T U V W X
P I B K T
L R C N U
A E D O V
Y X G Q W
F M H S X
4. Our next pair is ME Based on logic of step 3. Now Third encrypted pair for ME is - IX
P I B K T P I B K T
L R C N U L R C N U
A E D O V A E D O V
Y X G Q W Y X G Q W
F M H S X F M H S X
P I B K T
L R C N U
A E D O V
Y X G Q W
F M H S X
7. Next pair is UL Use the step 4. Now the Sixth & last encrypted pair for UL is LR
P I B K T
L R C N U
A E D O V
Y X G Q W
F M H S X
7. Hill Cipher
Hill Cipher has its roots in matrix theory. Understand by Example We have Plaintext CAT and now we are encrypting it by using Hill Cipher Substitution technique. 1. Treat all character as a number. So that A=0, B=1, C=2,, Z=25 2. Organize a matrix by using plaintext. Here Plaintext is CAT. So that C=2, A=0, T=19. This is known as Plaintext Matrix. ( )
3. Chose a random key matrix. This key matrix consists of size nxn order. ( )
4. Multiply both the Matrix (i.e. Key Matrix & Plaintext Matrix). ( ) ( ) ( )
5. Now compute a mod 26 value of the above resultant matrix. That is, take reminder after dividing the above matrix values by 26. That is: ( 6. 7. 8. 9. ) ( )
31/26 = 1 with reminder 5 which goes in above matrix and so on. Translating number in to alphabet. i.e. 5=F, 8=I, and 13=N Our Cipher text is FIN For Decryption: Multiply the cipher text matrix & Inverse of Key Matrix. ( ) ( ) ( )
2. Now read the text row-by-row, and write it sequentially. Thus we have: CMHMTMROOEOEOORW as the cipher text.
2. Now, let us decide the order of columns as some random order, say 4, 6, 1, 2, 5 & 3. Then read the text in the order of these columns. 3. The cipher text thus obtained would be EOWOOCMROEHMMTO.
12.XOR Cipher
A key as the Second input In other words one of the inputs is the block to be encrypted, the other input is a key; result is the encrypted block. Size of plaintext, key & cipher text is all the same.
13.Rotation Cipher
It is another common cipher. In Rotation cipher; input bits are rotated to left or right Rotation cipher can be keyed or keyless In keyed rotation: Value of key defines the number of rotations. In keyless rotation: The numbers of rotations are fixed. Rotation cipher using the bits instead of characters. If the length of original stream is N. then after N rotations, we get the original input stream.
DES Function Heart of the DES is the DES Function. The DES Function applies a 48-bit key to the rightmost 32 bits Ri to produce 32-bit output. This function made up of four operations: XOR Expansion Permutation Group of S-boxes. Straight Permutation
How DES Works It encrypts the data of 64 bit plaintext using key length of 56 bit (i.e. 64 bit plaintext goes to the input of DES, which produce the 64 bit cipher text). We have mentioned that DES uses the 56-bit key; actually the initial key consists of 64 bits. However, Before the DES process even starts, every 8th bit of the key is discarded to produce 56-bit key. That is, positions 8, 16, 24, 32, 40, 48, 56, 64 (total 8 bits). i.e. 64-8 =56 bit key. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 Discarding of every 8th bit of original key DES is based on two fundamental attributes : 1. Substitution (also called confusion) 2. Transposition (also called diffusion) DES consists of 16 steps, each of which is called as a round. Each round performs the steps of substitution & transposition.
Broad-level Steps 1. First step the 64 bit plaintext block is handed over to an initial Permutation (IP) function. 2. The initial permutation is performed on plaintext. 3. Next, IP produces two halves of permuted block; LPT & RPT (left Plain text & Right Plain text). 4. Now, each of LPT and RPT go through 16 rounds of encryption process. 5. In the end, LPT & RPT rejoined and a Final permutation is performed on combined block. 6. The result of this process produces 64-bit cipher text.