ID 2310 CNS Assignment
ID 2310 CNS Assignment
ID 2310 CNS Assignment
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
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.
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.
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.
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