Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

ID 2310 CNS Assignment

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

INSTITUTE of INFORMATION

TECHNOLOGY
JAHANGIRNAGAR UNIVERSITY
COURSE TITLE: COMPUTER NETWORK & SECURITY
COURSE CODE: ICT-4257
ASSIGNMENT-
Submitted to: Professor K M Akkas Ali
Submitted by: Mehedi Hassan
ID: 2310
Question
Illustrate various Mono- and Poly-Alphabetic Substitution Ciphers.

Answer
1. Monoalphabetic Substitution Ciphers:
o Additive Cipher (Shift or Caesar Cipher):
 In the additive cipher, each letter in the plaintext is
shifted a fixed number of positions in the alphabet to
encrypt the message.
 For example, if we shift each letter in the plaintext
"hello" by 3 positions, we get the ciphertext
"KHOOR".
Example:
Plaintext: HELLO
Shift: 3
Ciphertext: KHOOR

o Multiplicative Cipher:
 The multiplicative cipher involves multiplying each
letter's numerical value by a constant to encrypt the
message.
o Affine Cipher:
 The affine cipher combines the additive and
multiplicative ciphers by applying both operations
to each letter in the plaintext.
Example:
Encryption: E(x) = (ax + b) mod 26
Decryption: D(y) = a^-1(y - b) mod 26

2. Polyalphabetic Substitution Ciphers:


o Autokey Cipher:
 In the autokey cipher, a keyword is concatenated
with the plaintext to create the keystream for
encryption.

o Playfair Cipher:
 The Playfair cipher uses a 5x5 grid of letters to
encrypt digraphs (pairs of letters) from the
plaintext.
Example:
Key: MONARCHY
Plaintext: HELLO
Ciphertext: EGKLL
o Vigenere Cipher:
 The Vigenere cipher uses a keyword to determine
the amount of shift applied to each letter in the
plaintext.
Example:
Keyword: KEY
Plaintext: HELLO
Ciphertext: RIJVS

o Hill Cipher:
 The Hill cipher involves matrix multiplication to
encrypt blocks of letters in the plaintext

Mechanism:
1. Monoalphabetic Ciphers:
o Additive Cipher (Caesar Cipher):
1. Choose a shift value (key) for encryption.
2. Each letter in the plaintext is shifted by the key
value to encrypt the message.
3. Encryption Formula: E(x) = (x + k) mod 26,
where x is the plaintext letter's numerical
value.
4. Decryption is done by shifting the ciphertext
letters back by the key value.

Figure: Additive Cipher

o Affine Cipher:
1. Encryption Formula: E(x) = (ax + b) mod 26,
where a and b are key values.
2. Decryption Formula: D(y) = a^-1(y - b) mod 26,
where y is the ciphertext letter's numerical
value.
3. Combines multiplication and addition
operations for encryption and decryption.

Figure: Affine Cipher


2. Polyalphabetic Ciphers:
o Vigenere Cipher:
1. Choose a keyword repeated to match the
length of the plaintext.
2. Each letter in the plaintext is shifted by the
corresponding letter in the keyword.
3. Encryption Formula: E(x) = (x + k) mod 26,
where k is the keyword letter's numerical
value.
4. Decryption is done by shifting the ciphertext
letters back using the keyword.

Figure: Vignere Cipher

o Playfair Cipher:
1. Create a 5x5 grid with a keyword (excluding
duplicates) for encryption.
2. Process the plaintext in pairs (digraphs) and
encrypt based on the grid rules.
3. If the letters are in the same row, replace them
with the letters to their immediate right
(wrapping around if needed).
4. If the letters are in the same column, replace
them with the letters below.

Figure: Playfair Cipher

o Hill Cipher:
1. Represent the plaintext as matrices and choose
a key matrix for encryption.
2. Multiply the plaintext matrix by the key matrix
to get the ciphertext matrix.
3. Decryption involves multiplying the ciphertext
matrix by the inverse of the key matrix.
Figure: Hill Cipher

Similarities & Dissimilarities:


1. Similarities:
o Both monoalphabetic and polyalphabetic
ciphers are substitution ciphers that replace
plaintext characters with ciphertext characters.
o They aim to obscure the relationship between
the plaintext and ciphertext to enhance security.
o Both types of ciphers can be implemented using
mathematical operations on the alphabet, such
as shifting or matrix transformations.
2. Dissimilarities:
o Monoalphabetic Ciphers:
 Each letter in the plaintext is consistently
replaced by the same letter in the
ciphertext.
 Vulnerable to frequency analysis due to
fixed substitution patterns.
 Limited key space compared to
polyalphabetic ciphers.
o Polyalphabetic Ciphers:
 Each letter in the plaintext can be replaced
by different letters based on the key or
algorithm.
 Resistant to frequency analysis due to
varying substitution patterns.
 Larger key space, making them more secure
than monoalphabetic ciphers.
In summary, monoalphabetic ciphers have a one-to-one
mapping between plaintext and ciphertext characters,
making them vulnerable to frequency analysis. On the
other hand, polyalphabetic ciphers introduce variability
in the substitution patterns, enhancing security by
complicating cryptanalysis techniques like frequency
analysis.

You might also like