INDIAN INSTITUTE OF INFORMATION TECHNOLOGY
KOTTAYAM
Department of Computer Science and Engineering
Programming Assignment-1
COURSE TITLE: Cryptography and Network Security (CSS411)
Course Instructor: Dr. Goutam Date: 13/08/2025
Batch: Batch II (Adm-2022) Due Date: 20/08/2025
Instructions to the students: Use only Python/C++ programming language.
For this assignment, the characters will be mapped to numbers in the range 0 . . . 127. The
mapping is the standard ASCII code system.
The text to be used for the encryption exercises is given below.
“This cryptosystem is not secure.”
Use this plaintext for problems 2 and 3.
1. Write a program to decrypt the following ciphertext, which was encrypted using a Shift
Cipher (Use exhaustive key search):
BEEAKFYDJXUQYHYJIQRYHTYJIQFBQDUYJIIKFUHCQD.
2. Affine Ciphers
Every letter is encrypted separately. All arithmetic should be performed modulo 128.
𝑒1 (𝑐) = 119c + 91.
𝑑1 (𝑐) = 71c + 67.
a. Write program to encrypt and decrypt strings using this affine cipher.
b. Encrypt and decrypt the sample text.
c. Encrypt also the string “AQUATIC” using the affine cipher 𝑒2 (𝑐) = 8c − 33.
3. Vigenère Cipher
Letters are encrypted in sets of length n by adding a vector k. All arithmetic should be
performed modulo 128.
k = {5, 3, 22, 1, 113}.
a. Write program to encrypt and decrypt strings using this Vigenère cipher.
b. Encrypt and decrypt the sample text.
c. Choose a vector k of a different length and perform the encryption and
decryption.