Question: Procedure: Implement, in LC - 3 assembly language, an encryption and a decryption programs that meet the following requirements: 1 . The key is 6

Procedure:
Implement, in LC-3 assembly language, an encryption and a decryption programs that meet the
following requirements:
1. The key is 6 and stored at x3100.
2. Your message is restricted to a maximum of 32 characters. They are stored at x3110 to
x311F. The last ASCII code of the text string must be EOT (x04).
3. The encryption algorithm is as follows. Each ASCII code in the message will be
transformed as follows:
The lower 4-bits of the code will be toggled. That is, if it is a 1, it will be replaced
by 0 and vice verse.
The key will be added to the result of step 1 above.
The result should be stored at location x3120 to x312F.
For example, if the input (plain text) is A, toggles lower 4 bits, and the encryption
key is 6, the program should take the ASCII value of A,01000001, toggle bit [3:0],
producing 01001110 and then add the encryption key, 6. The final output
character would be 01010100, which is the ASCII value T.
4. Decryption algorithm is as follows. Each ASCII code in the message will be transformed
as follows:
Subtract the encryption key from the ASCII code.
Toggle the low order bit of the result of step 1.
The result should be stored back to location x3110 to x311F.

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