Create a Vigenere cipher using assembly language file x86 Im

Create a Vigenere cipher using assembly language file (x86)

Im not really sure how to start or get it to work but would like some help.

1. Your code should use STDIN and STDOUT for input and output. (This is the default.) Use redirection on the command line to read from a file and write to a file.

2. Your code should open a file, read it character by character and save it into an array.

3. When you get to the end of the file you should encode the contents of the array with a Vigenere cipher using the keyword CRYPTOGRAM, then print it out.

4. Maintain the distinction between upper-case and lower-case letters, and do not modify non-alphabetic characters. This is not very good for the security of your message, but the result will look neater.

5. This program should use glibc functions. In addition to printf(), you may need getchar() and putchar().

6. Assume that the input file contains just ASCII text Don\'t worry about what happens with non-text files.

7. Once the encoder is working, build a decoder by duplicating the code and changing the addition to a subtraction.

8. If you use printf() to output the array, remember that a null termination is required on a string.

Solution

extern putchar, getchar, printf global main SECTION .data fmt: db \"characters = %d\", 10,0 SECTION .bss SECTION .text global main main: xor eax, eax xor ebx, ebx start: call getchar cmp eax, -1 jle exit inc ebx; cmp eax, \"A\" jl print cmp eax, \"z\" jg print cmp eax, \"Z\" jle rotup cmp eax, \"a\" jge rotlow jmp print rotup: cmp eax, \"M\" jle add13 sub eax, 13 jmp print rotlow: cmp eax, \"m\" jle add13 sub eax, 13 jmp print add13: add eax,13 jmp print print: push eax; call putchar add esp,4 jmp start exit: push ebx push fmt call printf add esp,8 ret
Create a Vigenere cipher using assembly language file (x86) Im not really sure how to start or get it to work but would like some help. 1. Your code should use

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site