Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

encrypt.asm This part of the program will input two strings, with appropriate prompts. The program will then take, character by character, the original message and

image text in transcribedimage text in transcribed

encrypt.asm This part of the program will input two strings, with appropriate prompts. The program will then take, character by character, the original message and the key and apply the Vigenre cipher [1] (algorithm for encryption) to it. To collect a single byte from memory, try something like the following: mov dl, [rax] In the above example, 'dl' is an 8-bit register (actually, the low order 8 bits of the 64-bit register rdx). Similarly, there are al, bl, cl (and even ah, bh, ch, and dh). The Vigenre cipher is a relatively old idea. It takes a key of any size, which is a series of letters (e.g. a word). The key is used repeatedly so that each character in the plaintext has a corresponding letter from the key. For example, here is the match-up for the key 'OPENSESAME' and the message MEETUSATTWELVEOCLOCKSHARP Plaintext: MEETUSATTWELVEOCLOCKSHARP Key antet OPENSESAMEOPENSESAMEOPENS Note: Duplicating the key so that it is the same length as the message is one of the trickiest parts of this program. Create a sufficiently large string variable for the result (e.g. duplicatedKey), copy the letters from key until you get to the null-terminator (a character equal to zero). Keep a count of how many characters have been copied, and stop when that count reaches the message length. Whenever you get to the end of the key, go back to the first character. The letter ?, above the M, in the leftmost column in the above example means that your algorithm will apply a Caesar-O shift. This is a fancy way of saying that you will add 14 to the ASCII value for M (with wrap-around if the value goes beyond 'Z'). A full table of the shifts is given in the table below. For example, in the leftmost column in the above example, the result would be the ASCII value of M+ which would be 'A' (due to wrap-around). encrypt.asm This part of the program will input two strings, with appropriate prompts. The program will then take, character by character, the original message and the key and apply the Vigenre cipher [1] (algorithm for encryption) to it. To collect a single byte from memory, try something like the following: mov dl, [rax] In the above example, 'dl' is an 8-bit register (actually, the low order 8 bits of the 64-bit register rdx). Similarly, there are al, bl, cl (and even ah, bh, ch, and dh). The Vigenre cipher is a relatively old idea. It takes a key of any size, which is a series of letters (e.g. a word). The key is used repeatedly so that each character in the plaintext has a corresponding letter from the key. For example, here is the match-up for the key 'OPENSESAME' and the message MEETUSATTWELVEOCLOCKSHARP Plaintext: MEETUSATTWELVEOCLOCKSHARP Key antet OPENSESAMEOPENSESAMEOPENS Note: Duplicating the key so that it is the same length as the message is one of the trickiest parts of this program. Create a sufficiently large string variable for the result (e.g. duplicatedKey), copy the letters from key until you get to the null-terminator (a character equal to zero). Keep a count of how many characters have been copied, and stop when that count reaches the message length. Whenever you get to the end of the key, go back to the first character. The letter ?, above the M, in the leftmost column in the above example means that your algorithm will apply a Caesar-O shift. This is a fancy way of saying that you will add 14 to the ASCII value for M (with wrap-around if the value goes beyond 'Z'). A full table of the shifts is given in the table below. For example, in the leftmost column in the above example, the result would be the ASCII value of M+ which would be 'A' (due to wrap-around)

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_2

Step: 3

blur-text-image_3

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

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions

Question

Explain the value of a true open-door policy

Answered: 1 week ago

Question

7. How might you go about testing these assumptions?

Answered: 1 week ago