To demonstrate the working of Stream Cipher using a simple XOR function. The input should be stored in Linked List and the XOR should be a separate function. This function can be extended for advanced stream ciphers later. The program should get the file as input, show the key and cipher text on the command line while encrypting, and store the output in a new file while decrypting.
Python program that demonstrates the working of a stream cipher using a simple XOR function. The program takes a file as input, prompts the user for a key, and performs the XOR operation on the file's contents using the key. The resulting cipher text is then displayed on the command line and stored in a new file.
To implement the XOR function, we will define a separate function called xor_encrypt()
that takes two input strings (the plaintext and the key) and returns the XOR of the two. We will also use a linked list to store the plaintext data.
To run this program, simply enter the name of the file you want to encrypt when prompted, and then enter the key you want to use for the encryption. The program will then perform the XOR operation on the file's contents using the key, display the resulting ciphertext on the command line, and write the encrypted data to a new file. It will also decrypt the file and write the decrypted data to another new file !