Crypto - Ch03 - P2 2
Crypto - Ch03 - P2 2
by William Stallings
Cryptography and Network Security
William Stallings, Edition-7
Solution: 1
Since matrix is 3x3: then text will be treated as 3 letters at a time:
4. Final Result
AB C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 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
Polyalphabetic Ciphers
• Polyalphabetic substitution cipher
– Improves on the simple monoalphabetic
technique by using different monoalphabetic
substitutions as one proceeds through the
plaintext message
All these techniques have the following features
in common:
• A set of related monoalphabetic substitution
rules is used
• A key determines which particular rule is
chosen for a given transformation
ABCDEFGH I J K L M N O P Q R S T U V W X Y Z
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Vigener table
• The Vigenère cipher uses a 26×26 table with A to Z as
the row heading and column heading This table is
usually referred to as the Vigenère
Tableau, Vigenère Table or Vigenère Square. We
shall use Vigenère Table.
• The first row of this table has the 26 English letters.
Starting with the second row, each row has the
letters shifted to the left one position in a cyclic way.
For example, when B is shifted to the first position on
the second row, the letter A moves to the end.
Vigenère
Table
Decrypt Using Vigener Table
• To decrypt, pick a letter in the
ciphertext and its
corresponding letter in the
keyword, use the keyword
letter to find the
corresponding row, and search
in that row for cipher letter,
take the header of that col
where cipher letter found as
plain letter.
• Consider the fifth letter P in
the ciphertext. This letter
corresponds to the keyword
letter H and row H is used to
find P. Since P is on column I,
the corresponding plaintext
letter is I.
Vigenère Autokey System
• A keyword is concatenated with the plaintext itself to
provide a running key. (avoid repeating keyword)
• Example:
key: deceptivewearediscoveredsav
plaintext: wearediscoveredsaveyourself
ciphertext: ZICVTWQNGKZEIIGASXSTSLVVWLA
28 - 26 = 2 ==> C
CIPHER-TEXT: C
ABCDEFGH I J K L M N O P Q R S T U V W X Y
Z
One-Time Pad (Stream Cipher)
• Improvement to Vernam cipher proposed by an Army Signal Corp
officer, Joseph Mauborgne
• The two requirements for the One-Time pad are:
– The key should be randomly generated as long as the size of the
message.
– The key is to be used to encrypt and decrypt a single message,
and then it is discarded.
• Each new message requires a new key of the same length as the new
message.
• Scheme is unbreakable (the only available scheme that is completely secure)
– Produces random output that bears no statistical relationship to
the plaintext
– Because the ciphertext contains no information whatsoever about
the plaintext, there is simply no way to break the code
© 2017 Pearson Education, Ltd., All rights reserved.
Difficulties
• The one-time pad offers complete security but, in practice, has two
fundamental difficulties:
– There is the practical problem of making large quantities of random
keys
• Any heavily used system might require millions of random
characters on a regular basis
– Mammoth key distribution problem
• For every message to be sent, a key of equal length is needed by
both sender and receiver
• Because of these difficulties, the one-time pad is of limited utility
– Useful primarily for low-bandwidth channels requiring very high
security
• The one-time pad is the only cryptosystem that exhibits perfect secrecy.
Encryption:
1. Construct a matrix where:
– Number of rows = key
– Number of coloms = number of letters in plain tex
2. In the rail fence cipher, the plain-text is written downwards and diagonally on
successive rails of an imaginary fence.
3. When we reach the bottom rail, we traverse upwards moving diagonally, after
reaching the top rail, the direction is changed again. Thus the alphabets of the
message are written in a zig-zag manner.
4. After each alphabet has been written, the individual rows are combined to obtain
the cipher-text.
Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ
For the type of columnar transposition just shown, cryptanalysis is fairly
straightforward and involves laying out the ciphertext in a matrix and playing
around with column positions. Digram and trigram frequency tables can be useful.
Row-Col Transposition Cipher
• The transposition cipher can be made significantly more
secure by performing more than one stage of transposition
(multiple stage of encryption). The result is a more complex
permutation that is not easily reconstructed.
• So if we can apply make double transposition in the previous
example, by taking the cipher text and using the same key and
the same algorithm
//Vernam Cipher
https://www.youtube.com/watch?v=Qojvtgf7SQw
Summary
• Symmetric Cipher • Substitution
Model techniques
– Cryptography – Caesar cipher
– Cryptanalysis and – Monoalphabetic
Brute-Force Attack ciphers
• Transposition – Playfair cipher
techniques – Hill cipher
• Rotor machines – Polyalphabetic
ciphers
– One-time pad
• Steganography
© 2017 Pearson Education, Ltd., All rights reserved.