Question: *this question has been posted previously without an answer for 13 hours. I am working on a MIPS project that involves encrypting / decrypting a
*this question has been posted previously without an answer for 13 hours.
I am working on a MIPS project that involves encrypting / decrypting a string by iterating through said string, adding a value to the character's ascii value and toggle a bit with xor. With the code I have:
.data
prompt_string: .asciiz "Enter text to encrypt:"
user_string: .byte 0x0f:100
message:.asciiz "Encrypted Text:"
.text
#prompt user for string
la $a0,prompt_string
li $v0,4
syscall
#enter user input into memory called user_string
la $t0,user_string
la $a1,10
li $v0,8
syscall
la $t0,user_string
lb $t1,0($t0)
addi $t1,$t1,4 #addition key
li $s0,0x01
li $v0,1 #toggle key
sllv $s0,$s0,$v0
xor $t4,$t1,$s0
la $t5 user_string
sb $t4,0($t5)
#display output
li $v0,4
la $a0,message
syscall
#display encrypted text
li $v0,4
la $a0,user_string
syscall
##questions
how to put the variable into addition key and toggle key?(must created prompt for those)
how to loop to the next charcter for instance the 'e' in "Hello" (addi $t0,$t0,1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
