; Welcome to the shift cipher program data segment ; add your data here! Enter db OAH,ODH,"$" welcome db "Welcome to the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

; Welcome to the shift cipher program data segment ; add your data here! Enter db OAH,ODH,"$" welcome db "Welcome to the

Post by answerhappygod »

Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 1
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 1 (52.11 KiB) Viewed 39 times
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 2
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 2 (52.11 KiB) Viewed 39 times
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 3
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 3 (29.83 KiB) Viewed 39 times
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 4
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 4 (27.93 KiB) Viewed 39 times
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 5
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 5 (27.31 KiB) Viewed 39 times
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 6
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 6 (26.1 KiB) Viewed 39 times
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 7
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 7 (38.98 KiB) Viewed 39 times
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 8
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 8 (27.07 KiB) Viewed 39 times
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 9
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 9 (24.26 KiB) Viewed 39 times
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 10
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 10 (24.02 KiB) Viewed 39 times
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 11
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 11 (67.69 KiB) Viewed 39 times
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 12
Welcome To The Shift Cipher Program Data Segment Add Your Data Here Enter Db Oah Odh Welcome Db Welcome To The 12 (58.66 KiB) Viewed 39 times
; Welcome to the shift cipher program data segment ; add your data here! Enter db OAH,ODH,"$" welcome db "Welcome to the shifting program $" choice db "if you want to encrypt, type E or type D for decryption $" Error_M db "That is an illegal character. Please try again :)" wrong db OAH,ODH, "Wrong choice please try again $" db Oah,Odh,"Enter the shifting key (a single digit from 1 to 9): $" text db "Enter the message of no more than 20 char when done, press <Enter>: $" cipher db "The ciphertext: $" plain db "The plaintext: $" res db 20 ;MAX NUMBER OF CHARACTERS ALLOWED (20). db ? NUMBER OF CHARACTERS key

CAMAUICNJ MLLUVCU 20). W db ? ¡NUMBER OF CHARACTERS ENTERED BY USER. db 20 dup(0);CHARACTERS ENTERED BY USER. len equ $- res ends stack segment dw 128 dup(0) ends code segment globalization: mov ax, data mov ds, ax mov es, ax ret program_info: only for displaying the output, input and string so that the user can understand call Newl

and string so that the user can understand call Newl mov ah, 9 mov dx, offset welcome int 21h call Newl ret choicee: mov ah, 9 mov dx, offset choice int 21h mov AH,1 int 21h cmp al,'E' JE Read ; if staetment cmp al, 'D' JE Read ; if else call Newl mov ah, 9 mov dx, offset Error_M int 21h call NewL mov ah, 9

call NewL mov ah, 9 mov dx, offset Wrong int 21h JMP choicee;to enter a valid choice which is the else staetment ret Read: mov [3100h),al ; save the choice as the qustion wants mov ah, 9 mov dx, offset key int 21h mov ah,1 int 21h sub al,30h mov (3101h),al cmp [3100h), 'D' JE Decode call NewL mov ah,9

mov ah,9 mov dx, offset text int 21h mov ah, OAh;SERVICE TO CAPTURE STRING FROM KEYBOARD. mov dx, offset res mov (3102h),dx int 21h call Newl call encrypt ret Encrypt: mov si, offset res add si, 1 mov ch, 0 mov cl, [si] push cx call Repeat ret ; we will use it in the decryption Repeat: inc si ro

inc si mov al, [si] ;GET THE CHAR FROM BUFFER add al, (3101H] ;ADD KEY mov [si-2],al iSTORE IT TO THE BEGINING OF THE BUFFER loop Repeat ;REPEAT mov [si],'$' ;ADD END OF STRING TO THE LAST 2 LOCATIONS mov (si-1],'$' mov ah, 09h mov ah,9 mov ah,09h mov bl,9 mov cx, 14 ; mov to cx number of char int 10h mov dx,offset cipher int 21h mov ah,9 mov dx, offset res ;DISPLAY THE STRING AFTER ENCRYPTION int 21h

int 21h ret Decode: call NewL mov cx, len mov ah,9 mov dx, offset text int 21h mov ah, OAh ;SERVICE TO CAPTURE STRING FROM KEYBOARD. mov dx, offset res mov [3102h),dx int 21h call Newl mov si, offset res ;ONCE THE OPTION D IS PRESSED pop cx call looping ret;LOAD CHAR COUNT INTO CX Looping: mov al, [si]

Looping: mov al, [si] sub al, [3101H) mov [si],al inc si dec cx JNZ looping mov ah,9 mov ah,09h ;for the coloring mov bl,9 mov cx, 14 ; mov to cx number of char int 10h mov dx,offset plain int 21h mov ah,9 mov dx,offset res ;DISPLAY THE DECRYPTED MESSAG int 21h ret NewL: mov ah,9

NewL: mov ah,9 mov dx,offset Enter int 21h ret Color: ENDD: mov AH,4ch int 21h start: call globalization ;to make code segment local call program_info ;welcoming message for the code call choicee call ENDD ends end start

Project Description: Background: Cryptography science deals with 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 it, 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. In order 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, of course, 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 simply replaces each letter with the one before it, and presto: the plain text HELLO WORLD is produced Assignment: Implement, in 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 ILLEGAL 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 x3100, and use it as we shall see momentarily 2. The prompt: ENTER THE ENCRYPTION KEY (A SINGLE DIGIT FROM 1 TO 9): The user will type a single digit, from 1 to 9. Again, we will assume the user is not an Aggie, and can successfully hit digit keys on the keyboard. Your program will accept this digit.store it in x3101. and use it to encrypt or decrypt the message. 3 .The prompt: INPUT A MESSAGE OF NO MORE THAN 20 CHARACTERS. WHEN DONE, PRESS <ENTERS. The user will put a character string from the keyboard, terminating the message with the <ENTER> key. Your program will store the message. starting in location x3102. Since the message is restricted to #20 characters, and there is an <ENTER> key at the end (which you may want to store) you must reserve locations 7102 to 3116 (21 locations) to store the message. (Note that 21 = x15. On

B Problem Statement: "Designing an Assembly Language Program that Simulates Operations of Shift Cipher Scheme(SCS)" Project Description: Background: Cryptography science deals with 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 it, 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. In order 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, of course, 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 simply replaces each letter with the one before it, and presto: the plain text HELLO WORLD K produced Assignment: Implement, in EMU8086 assernbly 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 EIF 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 ILLEGAL 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 X3100, and use it as we shall see momentarily. 2. The prompt: ENTER THE ENCRYPTION KEY (A SINGLE DIGIT FROM 1 TO 9): The user will type a single digit. from 1 to 9. Again, we will assume the user is not an Aggie. and can successfully hit digit keys on the keyboard. Your program will accept this digit.store it in x3101, 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 <ENTER> key. Your program will store the message starting in location x3102. Since the message is restricted to 20 characters, and there is an CENTER>> key at the end (which you may want to store) you must reserve locations x3102 to 3116 (21 locations) to store the message. (Note that #21x15.) One
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply