Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

assembly programming use MASM(X86), Dont use screen clear function such as Clrscr. Make a program that gets a plain text and a key as input.

assembly programming use MASM(X86), Dont use screen clear function such as Clrscr.

Make a program that gets a plain text and a key as input. Use the key to encrypt and decrypt the plain text by rotating each character of the key against a corresponding character in the message. Write a procedure that performs encryption.

*rotate : bitwise rotate instruction

*character : fits in 8-bit

NOTE:

  1. The length of plain text does not exceed 40 characters.
  2. Enter character () is not counted in string length.
  3. The size of each key element does not exceed 1 byte and the length of key does not exceed 10 integers.
  4. The negative value of key indicates a rotation to left and a positive value indicates a rotation to right.
  5. If the length of key is less than plain text, repeat the key as many times as necessary until all plain text is translated.

Ex. Plain text : Assembly, Key : -2, 4, 1, 0, -3

A

s

s

e

m

b

l

y

2 Rleft

4 Rright

1 Rright

0 Rotate

3 Rleft

2 Rleft

4 Rright

1 Rright

  1. Print out the original text, encrypted text, and decrypted text once the user enters a text and a key.
  2. Input Enter character () to finish the program.

C:\>s171234

Enter a plain text : This is the secret message

Enter a key : -2 4 1 0 -3

Original Text : This is the secret message

Encrypted Text : (print message encrypted by given key)

Decrypted Text : This is the secret message

Enter a plain text : I am your father

Enter a key : 1 -2 3 -4 5 -6 7 -8

Original Text : I am your father

Encrypted Text : (print message encrypted by given key)

Decrypted Text : I am your father

Enter a plain text :

Bye!

C:\>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Are You Legal A Personal Legal Audit And Empowerment Tool

Authors: Nelson P. Miller

1st Edition

099055533X, 978-0990555339

More Books

Students also viewed these Accounting questions

Question

List at least five tips for providing positive feedback.

Answered: 1 week ago