Question: For example, Caesar's cipher can have a code book below ( the key value is 3 ) . Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC If the key

For example, Caesar's cipher can have a code book below (the key value is 3).
Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC
If the key value 4 is selected in the substitution cipher, the string "APPLE" can be
encrypted into "ETTPI" as shown below.
Your task is to write an MIPS assembly language program to encrypt a plaintext string,
assuming that the key is 3.
Your program should meet the following requirements:
Prompt for and read an input string. Initially, the input string can be stored in a
static space allocated in the main memory.
Prompt to read the cipher key (integer) and store it in a register.
The input consists of a string that contains only uppercase letters without other
characters or special characters such as lowercase, spaces, periods, etc.
Write a function to dynamically allocate memory to hold and encrypt the output
string, which is the same length as the input string. Note: use stack to store the
parameters in the function ( $a0 for the address for the input string, $a1 for the
cipher key, and $ra for the value of $ra register, refer to the previous lab.)
Write a function to display/print the content in the dynamically allocated memory.
Write a function to calculate the length of the input string and show the length of
the dynamically allocated string.
For example, Caesar's cipher can have a code book

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!