This repository contains programs implemented in Cryptography and network security Lab in my 7th semester of SIT(VTU).

Perform encryption and decryption using monoalphabetic cipher. The program should support the following :
 Construct an input file named plaintext.txt (consisting of 1000 alphabets, without any space or special characters)
 Encrypt the characters of plaintext.txt and store the corresponding ciphertext characters in ciphertext.txt
 Compute the frequency of occurrence of each alphabet in both plaintext.txt and ciphertext.txt and tabulate the results

Write a program to perform the following using Playfair cipher technique
 Encrypt a given message M with different keys {k1,k2,...,kn}. Print key and cipher text pair
 Decrypt the cipher texts obtained in (i) to get back M

Write a program to perform the following using Hill cipher:
 Encrypt a message M with a given key matrix of size 2X2 and 3X3
 Decrypt the cipher text obtained in (i) by computing inverse of the respective key matrix.

Write a program to perform encryption and decryption using transposition technique with column permutation given as key.

Generate and print 48bit keys for all sixteen rounds of DES algorithm, given a 64bit initial key.

Given 64bit output of (i1)th round of DES, 48bit ith round key Ki and E table, find the 48bit input for Sbox.

Given 48bit input to Sbox and permutation table P, find the 32bit output Ri of ith round of DES algorithm.

Implement the following with respect to RC4:
 Print first n key bytes generated by key generation process.
 Illustrate encryption/decryption by accepting one byte data as input on the above generated keys.

Write a program to generate large random number using BBS random number generator algorithm and check whether the generated number is prime or not using RABINMILLER primality testing algorithm.

Implement RSA algorithm using clientserver concept. The program should support the following :
 Client generates {PU, PR} and distributes PU to Server.
 Sever encrypts message M using client’s public key {PU}.
 Client decrypts the message sent by server using its private key {PR}.

Implement RSA algorithm to process blocks of plaintext (refer Figure 9.7 of the text book), where plaintext is a string of characters and let the block size be two characters. (Note: assign a unique code to each plain text character i.e., a=00, A=26). The program should support the following.
 Accept string of characters as plaintext.
 Encryption takes plaintext and produces ciphertext characters.
 Decryption takes ciphertext characters obtained in step ii and produces corresponding plaintext characters
 Display the result after each step

Implement RSA algorithm using clientserver concept. Using this illustrate secret key distribution scenario with confidentiality and authentication. The program should support the following :

Compute common secret key between client and server using DiffieHellman key exchange technique. Perform encryption and decryption of message using the shared secret key (Use simple XOR operation to encrypt and decrypt the message.)

Implement DSS algorithm for signing and verification of messages between two parties (obtain H(M) using simple XOR method of hash computation on M).