0% found this document useful (0 votes)
9 views1 page

CNS Programming Assignment on Cryptography

The document outlines a programming assignment for a Cryptography and Network Security course at the Indian Institute of Information Technology, Kottayam. Students are instructed to use Python or C++ to implement various encryption and decryption techniques, including Shift Cipher, Affine Ciphers, and Vigenère Cipher, using specified plaintext and ciphertext. The assignment includes specific tasks such as exhaustive key search for decryption and performing arithmetic modulo 128.

Uploaded by

haseebprml
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)
9 views1 page

CNS Programming Assignment on Cryptography

The document outlines a programming assignment for a Cryptography and Network Security course at the Indian Institute of Information Technology, Kottayam. Students are instructed to use Python or C++ to implement various encryption and decryption techniques, including Shift Cipher, Affine Ciphers, and Vigenère Cipher, using specified plaintext and ciphertext. The assignment includes specific tasks such as exhaustive key search for decryption and performing arithmetic modulo 128.

Uploaded by

haseebprml
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

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.

You might also like