Question: in at&t assembly: Implement a cryptographic encoder / decoder that will input a line of text and output an encoding of the text. The method
in at&t assembly: Implement a cryptographic encoderdecoder that will input a line of text and output an
encoding of the text. The method will be similar to Caesars cipher and ROTsystem The user will
provide a verb encode or decodeand an integer key as a command line argument. This key will be
a decimal number. For each of the characters in the line of text to be encoded:
if it is between the space and the tilde use the formula c
c keymod
to compute the encoded character
if it is less than the space, use the character as is
if it is after the tilde, use the character as is
To decode, follow this method:
if it is between space and the tilde use the formula c
c keymod
mod to compute the encoded character
if it is less than space, use the character as is
if it is after the tilde, use the character as is
Here are some sample runs you should be able to produce.
$ echo "abcDEF" crypto encode
nopQRS
$ echo "abcDEF" crypto encode
@AB
$ echo "Hello, world!" crypto encode
HOORnbZRUOGc
$ echo cdecrypto decode
abc
$ echo Helloworldcrypto encode crypto decode
Hello, world!
In order to access the command line arguments, remember that stdlib is calling main with this signature:
int mainint argc, char argv
To read the string, use fgets and not scanfssince the latter will stop at the first white
space.
Save your program as crytpo.s
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
