Vigenère cipher program 1. Your code should use STDIN and STDOUT for input and o
ID: 3811578 • Letter: V
Question
Vigenère cipher program
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. Use C I/O functions.
3. When you get to the end of the file you should encode the contents of the
array with a Vigenère 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.
Explanation / Answer
#include #include char arr[26][26]; char message[22],key[22],emessage[22],retMessage[22]; int findRow(char); int findColumn(char); int findDecRow(char,int); int main() { int i=0,j,k,r,c; clrscr(); k=96; for(i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.