Question: Write Assembly code ( only assembly code and no procedure call ) that performs decryption ( recovers the original string ) of an encrypted string.

Write Assembly code (only assembly code and no procedure call) that performs decryption (recovers the original string) of an encrypted string. The encryption is performed by rotating each plaintext byte a varying number of positions in different directions. For example, in the following array that represents the encryption key, a negative value indicates a rotation to the left and a positive value indicates a rotation to the right (for rotation you are only allowed to use ROR instruction). The integer in each position indicates the magnitude of the rotation: key BYTE -4,4,-1,0,3,-5,2,-4
Encryption algorithm rotates each plaintext byte by the amount indicated by its matching key array value. Then, align the key to the next 8 bytes of the message and repeat the process.
Please remember that ROR eax, -3 is the same as ROL. eax,3
Here is a sample input:
.data
Encryptkey BYTE -4,4,-1,0,3,-5,2,-4
encrypted BYTE "1Hv$4Pq&JzXu8T@w"
size1= $-encrypted
decrypted BYTE DUP size1(?)(Please only in MASM )

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!