Question: Python language please Problem 1: Implement a simple symmetric cryptosystem based on the following method. a. Keys are 24-bit randomly generated values. b. Messages are

Python language please

Python language please Problem 1: Implement a simple symmetric cryptosystem based on

Problem 1: Implement a simple symmetric cryptosystem based on the following method. a. Keys are 24-bit randomly generated values. b. Messages are randomly generated strings with an even number of characters. (Valid characters are upper and lower case letters, as well as spaces.) One can always add a blank at the end of an odd-length string. C. The encryption of a message M of length n (in bytes) is given by Ex(M)=M (K || K || K ...), where the key K is repeated n/2 times. TI here is String Concatenation Operator. d. The decryption algorithm for a ciphertext C is the same as the encryption algorithm: D (C)=CO (K || K | K...). Helpful Hints: 1. Start by generating a random string of 24 bits for the key. 2. Generate 6 random BYTES (not bits) whose value falls between 48 - 122. a. i.e. 00110000 01000000 01000001 01000011 01000101 01000011 3. Find the ASCII values for each byte of the 6-byte message 4. Encrypt the message with the XOR operation as shown in the equation above and save the output as ciphertext a. i.e. do the XOR of the message and key 5. Decrypt the ciphertext with the equation shown above to get the output a. i.e. do the XOR of the ciphertext and the key 6. Take the decrypted text and find its equivalent ASCII values. If it matches the original message, then system works properly

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!