Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 Kis repeated n/2 times. "II" here is String Concatenation Operator. d. The decryption algorithm for a ciphertext C is the same as the encryption algorithm: Dx(C)=C (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. 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 Kis repeated n/2 times. "II" here is String Concatenation Operator. d. The decryption algorithm for a ciphertext C is the same as the encryption algorithm: Dx(C)=C (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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started