Docsity

Classical Encryption Techniques: Polyalphabetic and Transposition Ciphers Lab, Lab Reports of Network security

Toggle sidebar
bg1
CE-408: Cryptography & Network Security SSUET/QR/114
LAB#03
Classical Encryption Techniques (Polyalphabetic and
Transposition Ciphers)
OBJECTIVE
The purpose of this lab is to implement the following algorithms in MATLAB:
1. Polyalphabetic Cipher
2. Transposition Cipher
THEORY
1. POLYALPHABETIC CIPHER
Polyalphabetic ciphers are based on substitution or transposition mechanisms.
Improve security using multiple cipher alphabets.
It is a combination of separate monoalphabetic ciphers.
Make cryptanalysis harder with more alphabets to guess and flatter frequency distribution.
Use a key (or sometimes called key word) to select which alphabet is used for each letter
of the message. The length of the key is sometimes called the period of the encryption.
Use each alphabet in turn and repeat from start after end of key is reached.
The simplest polyalphabetic substitution cipher is called “Vigenère”
Effectively multiple Caesar ciphers
Key is multiple letters long K = k1 k2 ... kd
ith letter specifies ith alphabet to use and use each alphabet in turn.
Repeat from start after d letters in message
Decryption simply works in reverse
Vigenere Cipher
Write the plaintext out.
Write the keyword repeated above it.
Use each key letter as a Caesar cipher key.
Lab#03: Classical Encryption Techniques (Polyalphabetic ciphers)
Page | 13
pf3
pf4

Partial preview of the text

Download Classical Encryption Techniques: Polyalphabetic and Transposition Ciphers Lab and more Lab Reports Network security in PDF only on Docsity!

LAB#

Classical Encryption Techniques (Polyalphabetic and

Transposition Ciphers)

OBJECTIVE

The purpose of this lab is to implement the following algorithms in MATLAB:

  1. Polyalphabetic Cipher
  2. Transposition Cipher

THEORY

1. POLYALPHABETIC CIPHER

 Polyalphabetic ciphers are based on substitution or transposition mechanisms.  Improve security using multiple cipher alphabets.  It is a combination of separate monoalphabetic ciphers.  Make cryptanalysis harder with more alphabets to guess and flatter frequency distribution.  Use a key (or sometimes called key word ) to select which alphabet is used for each letter of the message. The length of the key is sometimes called the period of the encryption.  Use each alphabet in turn and repeat from start after end of key is reached.  The simplest polyalphabetic substitution cipher is called “Vigenère”  Effectively multiple Caesar ciphers  Key is multiple letters long K = k 1 k 2 ... kdith^ letter specifies ith^ alphabet to use and use each alphabet in turn.  Repeat from start after d letters in message  Decryption simply works in reverse Vigenere Cipher  Write the plaintext out.  Write the keyword repeated above it.  Use each key letter as a Caesar cipher key. Lab#03: Classical Encryption Techniques (Polyalphabetic ciphers)

 Encrypt the corresponding plaintext letter For Encryption Ci = Pi + ki For Decryption Pi = Ci - ki  Use the same concept of Ceasar cipher or monoalphabetic for letter look up using find() command. Hill Cipher In classical cryptography, the Hill cipher is a polygraphic substitution cipher based on linear algebra. Each letter is represented by a number modulo 26. Often the simple scheme A = 0, B = 1, ..., Z = 25 is used, but this is not an essential feature of the cipher. To encrypt a message, each block of n letters (considered as an n -component vector) is multiplied by an invertible n × n matrix, against modulus 26. To decrypt the message, each block is multiplied by the inverse of the matrix used for encryption. Lab#03: Classical Encryption Techniques (Polyalphabetic ciphers)

Matlab Code:  A simple tool for such technique is to use the transpose operator  You can use the reshape() command according to the depth parameter  For decryption, use the inverse of the key to rearrange the ciphertext back to plaintext

Lab Tasks:

  1. Implement Polyalphabetic both encryption and decryption of the plaintext “ilikecomputersecurity” such that the key is “sight”.
  2. Encrypt and decrypt the plaintext “over the crimson sky” using Rail Fence with depth 5.
  3. Encrypt and decrypt the plaintext “let us fly over the blue crimson sky ” using Keyed Transposition with the following key combination: 2 5 4 3 1 6.
  4. Encrypt your name by using key [5 6 ; 2 3] using Hill Cipher. Lab#03: Classical Encryption Techniques (Polyalphabetic ciphers)