Question
Please code in x86 programming language Write a procedure named Encrypt that performs simple encryption on a null-terminated ASCII byte array by rotating each plaintext
Please code in x86 programming language
Write a procedure named Encrypt that performs simple encryption on a null-terminated ASCII byte array by rotating each plaintext byte a varying number of positions in different directions using a key value stored in a key array with type BYTE.
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. The integer in each position indicates the magnitude of the rotation:
key BYTE -2, 4, 1, 0, -3, 5, 2, -4, -4, 6
Your procedure should loop through a plaintext message and align the key to the rst 10 bytes of the message. Rotate each plaintext byte by the amount indicated by its matching key array value. Then, align the key to the next 10 bytes of the message and repeat the process. Your plaintext string needs to be greater than 10 bytes in length. Your Encrypt procedure should encrypt the entire message with one call to it.
Write a test program that calls the Encrypt procedure once and passes the address offset of the plaintext string and key. Your test program should output the original plaintext string to the console before encryption and the string after it is encrypted.
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