Question: Assembly Language - Vigenere Cipher Hi I need help with this quesiton please. I am supposed to use only a make file to build and
Assembly Language - Vigenere Cipher
Hi I need help with this quesiton please. I am supposed to use only a make file to build and then run the program through command line. I will post what code I have so far if it helps for anything please and thanks.



Makefile:
all: encrypt.asm nasm -f elf64 -F dwarf -g -o encrypt.o encrypt.asm gcc -m64 -o encrypt encrypt.o
encrypt.asm:
extern printf extern scanf global main section .text uppercase: ; this is a function that converts a string to uppercase ; al
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, 'di 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' OPENSESAMEOPENSESAMEOPENS Key: Plaintext: MEETUSATTWELVEOCLOCKSHARP 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 nmull-terminator (a character equal to zero). Keep a count of how many characters have been copied, and stop twhen that count reaches the message length. Whenever you get to the end of the key, go back to the first character. The letter 'O' 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 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, 'di 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' OPENSESAMEOPENSESAMEOPENS Key: Plaintext: MEETUSATTWELVEOCLOCKSHARP 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 nmull-terminator (a character equal to zero). Keep a count of how many characters have been copied, and stop twhen that count reaches the message length. Whenever you get to the end of the key, go back to the first character. The letter 'O' 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
