Reference no: EM132207501
Write a procedure that performs simple encryption by rotating each plaintect 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.
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 first 10 bytes of that message.
Rotate each plaintext byte by the amount indicated by its matching key array value.
Then, align the key value 10 bytes of that message and repeat the process. Write a program that tests your encryption procedure by calling it twice, with different data sets.