[go: up one dir, main page]

0% found this document useful (0 votes)
35 views21 pages

Nisha Assignment

The document provides an overview of various encryption techniques, focusing on substitution and transposition methods. It details specific ciphers such as the Caesar Cipher, Monoalphabetic Cipher, Playfair Cipher, Hill Cipher, and Polyalphabetic Cipher, explaining their mechanisms and examples. Additionally, it includes multiple-choice questions to assess understanding of these techniques.

Uploaded by

aakashsharma6217
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)
35 views21 pages

Nisha Assignment

The document provides an overview of various encryption techniques, focusing on substitution and transposition methods. It details specific ciphers such as the Caesar Cipher, Monoalphabetic Cipher, Playfair Cipher, Hill Cipher, and Polyalphabetic Cipher, explaining their mechanisms and examples. Additionally, it includes multiple-choice questions to assess understanding of these techniques.

Uploaded by

aakashsharma6217
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/ 21

Name - Nisha

Roll no. - 237024030027


Father's name- Shri Vijaypal
Singh

Substitution technique

Substitution technique is a classical encryption technique


where the characters present in the original message are
replaced by the other characters or numbers or by
symbols. If the plain text (original message) is considered
as the string of bits, then the substitution technique would
replace bit pattern of plain text with the bit pattern of
cipher text.
We will discuss some of the substitution techniques which
will help us to understand the procedure of converting
plain text to cipher text. In this section, we will study the
following substitution techniques:

Substitution Techniques:
(1)​ Caesar Cipher
(2)​ Monoalphabetic Cipher
(3)​ Playfair Cipher
(4)​ Hill Cipher
(5)​ Polyalphabetic Cipher
(6)​ One-Time Pad

(1)​ Caesar Cipher


This is the simplest substitution cipher by Julius Caesar.
In this substitution technique, to encrypt the plain text,
each alphabet of the plain text is replaced by the alphabet
three places further it . And to decrypt the cipher text
each alphabet of cipher text is replaced by the alphabet
three places before it.

Let us take a simple example:

Plain Text: meet me tomorrow

Cipher Text: phhw ph wrpruurz

Look at the example above, we have replaced ‘m’ with ‘p’


which occurs three places after ‘m’. Similarly, ‘e’ is
replaced with ‘h’ which occurs in three places after ‘e’.

(2)Monoalphabetic Cipher

Monoalphabetic cipher is a substitution cipher, where the


cipher alphabet for each plain text alphabet is fixed, for
the entire encryption.
In simple words, if the alphabet ‘p’ in the plain text is
replaced by the cipher alphabet ‘d’. Then in the entire
plain text wherever the alphabet ‘p’ is used, it will be
replaced by the alphabet ‘d’ to form the ciphertext.

(3) Playfair Cipher

Playfair cipher is a substitution cipher which involves a


5X5 matrix. Let us discuss the technique of this Playfair
cipher with the help of an example:

Plain Text: meet me tomorrow

Key: KEYWORD

Now, we have to convert this plain text to ciphertext using


the given key. We will discuss the further process in steps.

Step 1: Create a 5X5 matrix and place the key in that


matrix row-wise from left to right. Then put the remaining
alphabet in the blank space.
Step 2: Now, you have to break the plain text into a pair of
alphabets.

Plain Text: meet me tomorrow

Pair: me et me to mo rx ro wz

Note
●​ Pair of alphabets must not contain the same letter. In
case, pair has the same letter then break it and add
‘x’ to the previous letter.
●​ Like in our example letter ‘rr’ occurs in pair so, we
have broken that pair and added ‘x’ to the first ‘r’.
●​ In case while making pair, the last pair has only one
alphabet left then we add ‘z’ to that alphabet to form
a pair as in our above example, we have added ‘z’ to
‘w’ because ‘w’ was left alone at last.
●​ If a pair has ‘xx’ then we break it and add ‘z’ to the
first ‘x’, i.e. ‘xz’ and ‘x_’.

Step 3: In this step, we will convert plain text into


ciphertext. For that, take the first pair of plain text and
check for cipher alphabets for the corresponding in the
matrix. To find cipher alphabets follow the rules below.

Note

●​ If both the alphabets of the pair occur in the same


row replace them with the alphabet to their
immediate right. If an alphabet of the pair occurs at
extreme right then replace it with the first element of
that row, i.e. the last element of the row in the matrix
circularly follows the first element of the same row.
●​ If the alphabets in the pair occur in the same column,
then replace them with the alphabet immediate below
them. Here also, the last element of the column
circularly follows the first element of the same
column.
●​ If the alphabets in the pair are neither in the same
column and nor in the same row, then the alphabet is
replaced by the element in its own row and the
corresponding column of the other alphabet of the
pair.
Pair: me et me to mo rx ro wz

Cipher Text: kn ku kn kz ks ta kc yo

So, this is how we can convert a plain text to ciphertext


using Playfair cipher. When compared with a
monoalphabetic cipher, the Playfair cipher is much more
advanced. But still, it is easy to break.

(4) Hill Cipher


Hill cipher is a polyalphabetic cipher introduced by Lester
Hill in 1929. Let us discuss the technique of hill cipher.

Plain text: Binary

Key: HILL

Choose the key in such a way that it always forms a square


matrix. With HILL as the key, we can form a 2×2 matrix.

Now, of plain text, you have to form a column vector of


length similar to the key matrix. In our case, the key
matrix is 2×2 then the column vectors of plain text would
be 2×1.

The general equation to find cipher text using hill cipher is


as follow:

C = PK mod 26 , P=CK-1mod 26
For example:
Ex- K= [ 11 8 K-1= [ 7 18
3 7 ]2*2 23 11 ]2*2
Plain text. JULY = 9 20 11 24
Take JU = 9 20. Then take LY = 11 24
[9,20] [ 11 8 [11,24] [ 11 8
3 7] = (3,4) 3 7]= (11,22)
Cipher text. [ 3 4 11 22] = [ D E L W ]

(5) Polyalphabetic Cipher


Polyalphabetic cipher is far more secure than a
monoalphabetic cipher. A monoalphabetic cipher maps a
plain text symbol or alphabet to a ciphertext symbol and
uses the same ciphertext symbol wherever that plain text
occurs in the message.But polyalphabetic cipher, each time
replaces the plain text with the different ciphertext.
Vignere cipher
●​ Keyword of m length is given.
●​ Divide plaintext into blocks of m length.
●​ Add plaintext and keyword mod 26.

P=C= K= (Z26)m , K= (k1,k2,..........km)


y= ek(x) = ek(x1,x2,x3…….xm) = ( x1+k1, x2+k2…………xm+km)
mod26
Plaintext= dk( y1,y2,y3……ym) = y1-k1, y2-k2,............ym-km) mod 26

Transposition technique
Transposition technique is an encryption method which is
achieved by performing permutation over the plain text.
Write diagonally and read horizontally.Mapping plain text
into cipher text using a transposition technique is called
transposition cipher.
On the one hand, the substitution technique substitutes a
plain text symbol with a cipher text symbol. On the other
hand, the transposition technique executes permutation on
the plain text to obtain the cipher text.
Transposition Techniques
1.​Rail Fence Transposition
2.​Columnar Transposition
3.​Improved Columnar Transposition
4.​Book Cipher/Running Key Cipher

Rail Fence Cipher

The rail fence cipher is the simplest


transposition cipher. The steps to obtain
cipher text using this technique are as
follow:

Step 1: The plain text is written as a


sequence of diagonals.

Step 2: Then, to obtain the cipher text the


text is read as a sequence of rows.
To understand this in a better way, let us
take an example:
Plain Text: meet me Tomorrow

Now, we will write this plain text sequence


wise in a diagonal form as you can see
below:

Once you have written the message as a

sequence of diagonals, to obtain the cipher text

out of it you have to read it as a sequence of

rows. So, reading the first row the first half of

cipher text will be.

memtmro
reading the second row of the rail fence, we will

get the second half of the cipher text:

eteoorw

Now, to obtain the complete cipher text combine

both the halves of cipher text and the complete

cipher text will be:

Cipher Text: M E M T M R O E T E O O R W

Rail fence cipher is easy to implement and even

easy for a cryptanalyst to break this technique.

So, there was a need for a more complex

technique.

MCQ QUESTIONS
(1) Which of the following is not a type of

transposition cipher ?

(a) Rail fence cipher



(b) Columnar transposition cipher

(c) One time pad cipher

(d) Route cipher

Answer - © one time pad cipher

(2) Which of the following is not a type of



Monoalphabetic cipher?

(a) Additive cipher



(b) Multiplicative cipher

(c) Affine cipher

(d) Hill cipher

Answer - (d) hill cipher
(3) Encrypt the message “ HELLO MY

DEARZ” using transposition cipher with

Key - Plain text 2 4 1 3

Cipher text 1 2 3 4.

(a) HLLEO YM AEDRZ



(b) EHOLL ZYM RAED

(c) ELHL MDOY AZER

(d) ELHL DOMY ZAER

Answer - © ELHL MODY AZER

(4) Use Caesar’s cipher to decipher the



following HQFUBSWHG WHAW.

(a) ABANDONED LOCK



(b) ENCRYPTED TEXT

(c) ABANDONED TEXT

(d) ENCRYPTED LOCK

Answer - (b) ENCRYPTED TEXT

(5) Caesar cipher is an example of



(a) Poly-alphabetic cipher

(b) Mono-alphabetic cipher

(c) Multi-alphabetic cipher

(d) Bi-alphabetic cipher

Answer - (b) mono-alphabetic

(6) Monoalphabetic cipher is stronger than



Polyalphabetic ciphers because frequency

analysis is tougher on the former.

(a) True

(b) False

Answer - (b) false
(7) On encrypting “cryptography” using

vignere cipher system using the keyword

“LUCKY” we get cipher text.

(a) nlazeiiblijji

(b) nlazeiibljii

(c) olaaeiibljki

(d) mlaaeiibliki

Answer - (a) nlazeiiblijji

(8) Which of the following is not a type of



cipher?

(a) Substitution cipher



(b) Transposition cipher

(c) Vignere cipher

(d) RSA cipher

Answer - (d) RSA cipher

(9) Which of the following is a type of



transposition cipher?

(a) Caesar cipher



(b) Rail fence cipher

(c) Vignere cipher

(d) Playfair cipher

Answer - (b) Rail fence cipher

(10)Which of the following is a type of



substitution cipher?

(a) Caesar cipher



(b) Rail fence cipher

(c) Playfair cipher

(d) Vignere cipher

Answer - (a) Caesar cipher

(11) Which of the following cipher is created

by shuffling the letters of a word ?

(a) Substitution cipher



(b) Transposition cipher

(c) Polyalphabetic cipher

(d) Monoalphabetic cipher

Answer - (b) transposition cipher

(12) Which of the following ciphered text would

have used transposition cipher for encryption of

the plaintext “ SANFOUNDRY” ?

(a) SSCMBNUMERY

(b) TBMGPVOESZ

(c) UCNHQWPFTA

(d) SNONRAFUDY

Answer - (d) SNONRAFUDY

(13) Which of the following cannot be chosen as

a key in the Caesar cipher?

(a) An integer

(a) An alphabet (A-Z or a-z)

(b) A string

(c) None of the above

Answer - © A string

(14) Which of the following cipher techniques

include the involvement of matrix operations in

their algorithms of encryption and decryption?

(a) Hill cipher



(b) Playfair cipher

(c) Both a and b

(d) None of the above

Answer - © both a and b

(15) Which of the following ciphers is a block

cipher?

(a) Caesar cipher



(b) Vernam cipher

(c) Playfair cipher

(d) None of the above

Answer - © playfair cipher

(16) Vignere cipher is an example of ____

(a) Mono-alphabetic cipher



(b) Poly-alphabetic cipher

(c) Transposition cipher

(d) Additive cipher

Answer - (b) poly-alphabetic cipher

(17) Vignere table consists of ______

(a) 26 rows and 26 columns



(b) 26 rows and 1 column

(c) 1 row and 26 columns

(d) 27 rows and 27 columns

Answer - (a) 26 rows and 26 columns

(18) Which of the following is not a type of

Polyalphabetic cipher?

(a) Rotor cipher



(b) Hill cipher

(c) One time pad cipher

(d) Multiplicative cipher

Answer - (d) multiplicative cipher

(19) We are provided the plain text “SUN” . You

need to convert the given plain text into cipher

text under the Caesar cipher encryption

technique. Which of the following options is the

correct cipher text for the given text if the key is

2?

(a) UWP

(b) NUS

(c) WUP

(d) QSL

Answer - (a) UWP

(20) Combining transposition cipher with

substitution cipher improves its strength?


(a) True

(b) False

Answer - (a) true

You might also like