0% found this document useful (0 votes)
15 views28 pages

Lec-2 Classical Encryption Techniques

Uploaded by

charvipm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views28 pages

Lec-2 Classical Encryption Techniques

Uploaded by

charvipm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Cryptography

BIT – 410
Classical Encryption Techniques
Caesar Cipher:
• The Caesar cipher involves shifting each letter of the alphabet in the
plaintext with the letter standing three places further down the alphabet
in the ciphertext. For example:
• Plaintext: meet me after the toga party
• Cipher text: PHHW PH DIWHU WKH WRJD SDUWB
• Key(K)=3
Substitution Cipher(Monoalphabetic Cipher):
• A substitution technique is one in which the letters of plain text are
replaced by other letters or by numbers or symbols.

• The plaintext is viewed as a sequence of bits, then substitution involves


replacing plaintext bit patterns with cipher text bit patterns.

• In this cipher, the letters of the plain text are mapped to cipher text
letters based on a single alphabetic key.
Substitution Cipher(Monoalphabetic Cipher):
• Example:
Message:
Key:

• Plaintext: greetings of the day


• The encrypted Cipher text using Substitution Cipher Algorithm:
• Ciphertext: whuujydwi ev jxu tqo
Playfair Cipher:
• The Playfair algorithm is based on the use of a 5 × 5 matrix of letters
constructed using a keyword
• In this case, the keyword is monarchy. The matrix is constructed by filling
in the letters of the keyword (minus duplicates) from left to right and
from top to bottom, and then filling in the remainder of the matrix with
the remaining letters in alphabetic order. The letters I and J count as one
letter.
Playfair Cipher:
• Example:
• PlainText: "instruments"
• After Split: 'in' 'st' 'ru' 'me' 'nt' 'sz‘
Playfair Cipher:
• Plaintext is encrypted two letters at a time, according to the following
rules:
1. Repeating plaintext letters that are in the same pair are separated with
a filler letter, such as z, so that balloon would be treated as ba lz lo on(z
is a bogus letter).
2. Two plaintext letters that fall in the same row of the matrix are each
replaced by the letter to the right, with the first element of the row
circularly following the last. For example, ar is encrypted as RM.
Playfair Cipher:
• Plaintext is encrypted two letters at a time, according to the following
rules:
3. Two plaintext letters that fall in the same column are each replaced by
the letter beneath, with the top element of the column circularly
following the last. For example, mu is encrypted as CM.
4. Otherwise, each plaintext letter in a pair is replaced by the letter that
lies in its own row and the column occupied by the other plaintext
letter. Thus, hs becomes BP and ea becomes IM (or JM, as the
encipherer wishes).
Playfair Cipher:
• Example:
• PlainText: "instruments"
• After Split: 'in' 'st' 'ru' 'me' 'nt' 'sz‘
• Encrypted Text: gatlmzclrqtx
Playfair Cipher(Encryption):
• Encryption:
• i -> g
• n -> a
• s -> t
• t -> l
• r -> m
• u -> z
• m -> c
• e -> l
• n -> r
• t -> q
• s -> t
• z -> x
Playfair Cipher(Encryption):
Playfair Cipher(Decryption):
• Generate the key Square(5×5) at the receiver’s end:
• The key square is a 5×5 grid of alphabets that acts as the key for
encrypting the plaintext. Each of the 25 alphabets must be unique and
one letter of the alphabet (usually J) is omitted from the table (as the
table can hold only 25 alphabets). If the plaintext contains J, then it is
replaced by I.
• The initial alphabets in the key square are the unique alphabets of the
key in the order in which they appear followed by the remaining letters of
the alphabet in order.
Playfair Cipher(Decryption):
• If both the letters are in the same column: Take the letter above each one
(going back to the bottom if at the top).
• If both the letters are in the same row: Take the letter to the left of each
one (going back to the rightmost if at the leftmost position).
• If neither of the above rules is true: Each plaintext letter in a pair is
replaced by the letter that lies in its own row and the column occupied by
the other plaintext letter.
Playfair Cipher(Decryption):
Decryption:

(red)-> (green)
ga -> in
tl -> st
mz -> ru
cl -> me
rq -> nt
tx -> sz
Playfair Cipher(Decryption):
Vigenere Cipher
• Polyalphabetic substitution cipher is, also called a Vigenere Cipher.
• A polyalphabetic cipher is any cipher based on substitution, using
multiple substitution alphabets. The encryption of the original text is
done using the Vigenère square or Vigenère table.
• All these techniques have the following features in common:
1. A set of related monoalphabetic substitution rules is used
2. A key determines which particular rule is chosen for a given
transformation
Vigenere Cipher
• The Vigenère cipher uses a 26×26 table with A to Z as the row heading
and column heading
• 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.
Vigenere Cipher Table
Vigenere Cipher(Encryption):
• The first letter of the plaintext is paired with the first letter of the key. So
use row of first letter of the plaintext and column of first letter of the key
in the Vigenère square.
• Similarly, for the second letter of the plaintext, the second letter of the
key is used. The rest of the plaintext is enciphered in a similar fashion.
Vigenere Cipher(Decryption):
• Decryption is performed by going to the row in the table corresponding
to the key, finding the position of the ciphertext letter in this row, and
then using the column’s label as the plaintext.
Vigenere Cipher
• For example, suppose that the plaintext to be encrypted is:
Transposition Cipher
• Transposition Cipher is a cryptographic algorithm where the order of
alphabets in the plaintext is rearranged to form a cipher text. In this
process, the actual plain text alphabets are not included.

• The simplest such cipher is the rail fence technique, in which the
plaintext is written down as a sequence of diagonals and then read off
as a sequence of rows.
Transposition Cipher
• For example, to encipher the message “meet me after the toga party”
is written as:

• The encrypted message is read as: MEMATRHTGPRYETEFETEOAAT


Columnar Transposition Cipher
• In a transposition cipher, the order of the alphabets is re-arranged to
obtain the cipher-text.
• The message is written out in rows of a fixed length, and then read out
again column by column, and the columns are chosen in some
scrambled order.
• Width of the rows and the permutation of the columns are usually
defined by a keyword.
Columnar Transposition Cipher
• For example, the word HACK is of length 4 (so the rows are of length 4),
and the permutation is defined by the alphabetical order of the letters
in the keyword. In this case, the order would be “3 1 2 4”.
• Any spare spaces are filled with nulls or left blank or placed by a
character (Example: _).
• Finally, the message is read off in columns, in the order specified by the
keyword.
Columnar Transposition Cipher
Columnar Transposition Cipher
• For Decryption
1. To decipher it, the recipient has to work out the column lengths by
dividing the message length by the key length.
2. Then, write the message out in columns again, then re-order the
columns by reforming the key word.

You might also like