Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write an assembly code 8086 16 bit Do not repeat the solution [x) Problem Statement: Designing an Assembly Language Program that Simulates the Operations

please write an assembly code 8086 16 bit
Do not repeat the solution
image text in transcribed
image text in transcribed
[x) Problem Statement: "Designing an Assembly Language Program that Simulates the Operations of Basic Cipher Scheme(BCS) [) Project Description: Background: Cryptography science involves encrypting a message to remain secret from unauthorized users. Encrypting a file requires an input message, called the "plain text." and an encryption algorithm. An encryption algorithm transforms "plain text" into "ciphertext." Just like a door needs a key to lock and unlock, an encryption algorithm often requires a key to encrypt and decrypt a message. Just like a homeowner can selectively give the key to the front door to only those he wants to allow unaccompanied access, the author of a message can selectively give the encryption key to only those he wants to be able to read the message. For someone to read the encrypted message, he has to decrypt the ciphertext. which usually requires the key. For example. suppose the plain text message is HELLO WORLD. An encryption algorithm consisting of nothing more than replacing each letter with the next letter in the alphabet would produce the ciphertext IFMMP XPSME. If someone saw IFMMP XPSME, he would have no idea what it meant (unless he could figure it out or had the key to decrypt it.) The key to encrypt, in this case, is "pick the next letter in the alphabet," and the decryption key is "pick the previous letter in the alphabet." The decryption algorithm replaces each letter with the one before it, and presto: the plain text HELLO WORLD is produced. Assignment: Implement, in the EMU8086 assembly language emulator. an encryption/decryption program that meets the following requirements: Input: Your program should prompt the user for three separate inputs from the keyboard, as follows 1. The prompt: IF YOU WANT TO ENCRYPT, TYPE E; IF YOU WANT TO DECRYPT, TYPE D: The user will type E or D. A real-world program should also detect any other character typed and respond with THAT IS AN IULEGAL CHARACTER. PLEASE TRY AGAIN. We will assume in this assignment that the user can type an E or D correctly. Your program will accept that character. store it in 3100, and use it, as we shall see momentarily. 2. The prompt: ENTER THE ENCRYPTION KEY (A SINCLE DICIT FROM 1 TO 9): The user will type a single digit from 1 to 9 . Again, we will arsume the user is not an Agele and can wuccestully hit the digit keys on the keyboard. Your program will accept this digit. store it in 3101, and use it to encrypt or decrypt the message, 3 . The prompt: INPUT A MESSAGE OF NO MORE THAN 20 CHARACTERS. WHEN DONE, PRESS CENTER>. The user will input a character string from the keyboard. terminating the message with the key. Your program will tore the mersage. starting in location 3102. Since the mesiage is restricted to $20 characters, and there is a key at the end (which you may want to store). you must reserve locations 3102 to 3116(21 locations) to store the message. (Note that 21=15.) One constraint: Menages must be less than or equal to 820 characters. (Recallt; means the number is decimal.) Hint: to continually read from the keyboard without first printing a prompt on the sereen, use the appropriate interrupt (wuch as INT 21). For each key you wish to read, the EMU8086 operating system must execute this internupt service routine. Don't forget to follow the input interrupt with the indruction for interrupt for output, the character the user typer will be displayed on the screen. Algorithm: Basic Cipher Scheme (BCS) The encryption algorithm is as follows. Each ASCl code in the merrage will be transformed as follows : 1 the loworder bit of the code will be togsled. That is, if it is a 1 , it will be replaced by a 0 : if it is a 0 , it will be replaced by a 1 . 2. The key will be added to the rewit of step I above. For example. If the input (plain text) is A and the encryption key is 6 , the program thould take the ASCII value of A, 01000001, toggle bit [0.0]. producing 01000000 , and then add the encryption key. 6. The final cutput character would be otooon10, the ASCII value F. The decryption algorithm is the reverse. That is, 1 Subtract the encryption key from the ASCII code . 2. Toggle the low-order bit of the result of step 1 . For example, if the input (ciphertext) is F. and the encryption key is 6 . we fint subtract the encryption key fle., add 6 ) from the AsCII value of F. 01000110+11111010. yieiding 3 Cybersecunity Department, PSUT 01000000. We then toggle bit [0:0]. producing 01000001, which is the ASCII value for A. The result of the encryption/decryption algorithm should be stored in locations 3117 to 312A

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

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

3.2. Describe the DSM-5 approach to diagnosing mental disorders ?

Answered: 1 week ago

Question

5-8 What are the advantages and disadvantages of the BYOD movement?

Answered: 1 week ago