Question: A simple ROT encryption can be used to obfuscate a string of characters by adding a number to each character, called the key. Here is

A simple ROT encryption can be used to obfuscate a string of characters by adding a number to each
character, called the key. Here is a C++ function definition for the function encryptRQT(). The
function uses pass by reference, and forces the encrypted string to remain in the ASCII printable
character range.
// Preconditions: string s, int key
// Postconditions: encrypted s
void encryptROT (string& s, int key)
{
for (int s[i]=(s[i]+key)(s[i]33)s[i]=s[i]+33i=0;i
{
s[i]=(s[i]+key) & 128 ;
if(s[i]33)
{
s[i]=s[i]+33;
}
}
the code i was provided earlier for this did not work. I code in VS. please provide a working code.
code example -
.586
.MODEL FLAT
INCLUDE io.h ; header file for input/output
.STACK 4096
DA
valueA DWORD ?
valueB DWORD ?
valueC DWORD ?
prompt1 BYTE "Value of a?",0
prompt2 BYTE "Value of b?(not zero)",0
prompt3 BYTE "Value of c?",0
string BYTE 40 DUP (?)
result BYTE 11 DUP (?),0
resultLbl BYTE "Expression vaCODE
_MainProc PROC
 A simple ROT encryption can be used to obfuscate a string

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!