Question: Write a SASM program that encrypts a user-entered string using a user-entered key (required algorithm is given below). A sample execution of the program

Write a SASM program that encrypts a user-entered string using a user-entered key (required algorithm is

Write a SASM program that encrypts a user-entered string using a user-entered key (required algorithm is given below). A sample execution of the program looks like Enter key: abcde Enter plain text: coastisclear Encrypted: cpcvxiteoias Encryption Algorithm Use the encryption algorithm that was state-of-the-art in the mid 1800s. Consider each letter (of plain text, of the key, and of encrypted text) to be an integer, where a=0, b=1, and z=25. An encrypted character is defined to be the sum of a plain text character and a key character modulo 26. Since the key can be shorter than the plain text, the key is repeated as many times as needed. An example, with a key of "great" to encrypt the string "helloworld": key (repeated): great great key value: 6 17 4 0 19 6 17 4 0 19 plain text: hello world plain text value: 7 4 11 11 14 22 14 17 11 3 sum: 13 21 15 11 33 28 31 21 11 22 sum mod 26: 13 21 15 11 7 2 5 21 11 22 encrypted text: n v plh cf v l w Requirements 1. Your program must contain adequate comments (documentation). Such comments include your name or names if working with a partner. They also include a description of the program, as well as variable descriptions and comments about the code itself. 2. The key is to be exactly 5 lowercase letters. No error checking on the key is required. 3. The plain text will be a maximum of 25 characters, and they will all be lower case letters, no spaces. The newline character ends the plain text input. Assume that there are no errors in the plain text input. 4. You must use at least one array in your solution. Our primary goal with this assignment is the proper use of memory for data structures. 5. You should unit test all cases you can think of to ensure that your program operates as stated above. 6. You do not need to eat and swallow secret messages as what we are doing is not of a secure nature. Messages will not self-destruct in 5 seconds.

Step by Step Solution

3.29 Rating (155 Votes )

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 Programming Questions!