Write a program that will ask the user for a key to encrypted a message. The user is to type in a twenty-six letter key. Then the user is to enter some number of lines of plain-text. After each line has been entered by the user, this program will substitute a letter from the key for the plain-text letter:
Plain: A B C D E F
G H I J K L M
N O P Q R S T U V W X
Y Z
Message: This is a test
cipher: UIJTJ TBUFT U
Your program must allow either upcase or lowercase input, but the output
must be in uppercase. Also, notice the cipher is
printed out as groups of five letters, with the last group not having
that requirement. The user will type a Control-D when finished.
Email me (burt@umbc.edu) the typescript file on or before 22 Dec
98.
umbc9[3]% cc extra2.c
umbc9[4]% a.out
UMBC Secret Message Social Club
1 -- Encipher text
2 -- Decipher text
Enter your choice: 1
You must enter a cipher key that is 26 letters long.
Enter cipher key:
bcdefghijklmnopqrstuvwxyza
Enter plain text (Control-D to quit)
Plain: hello
cipher: IFMMP
plain: my name is gary burt
cipher: NZOBN FJTHB SZCVS U
plain: what is yours
cipher: XIBUJ TZPVS T
plain: have a nice day
cipher: IBWFB OJDFE BZ
plain:
Email me (burt@umbc.edu) the typescript file on or before 22 Dec 98.