Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are now to extend the above program to take as inputs files. The program should be able to read a file and encode or
You are now to extend the above program to take as inputs files. The program should be able to read a file and encode or decode it as needed. For the sake of simplicity, we assume that you only need to change letters [A-Z] in the file. You can safely ignore other letters in the file (i.e., keep those as is.) Encrypting a file to cyphertext Encrypt a file in.txt containing plaintext to a file out.txt containing ciphertext using shift in.txt out.txt Example Consider fi.txt HELLO WORLD THIS IS AMAZING WHY IS THIS SO AMAZING I HAVE NO IDEA 11231 After running the following command $ ./cf -e 3 fl.txt f2.txt File f2.txt looks like KHOOR ZRUOG WKLV LV DPDCLOU ZKB LV WKLV VR DPDCLOJ L KDYH QR LGHD 11231 Decrypting a file to plaintext Decrypting a file in.txt containing ciphertext to a file out.txt containing plaintext using shift (shift). Flag -d here refers to decryption. $ cf -d in. txt out.txt Example After running the following command $ cf -d 3 f2.txt f3.txt File f3.txt looks like HELLO WORLD THIS IS AMAZING WHY IS THIS SO AMAZING I HAVE NO IDEA 11231
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started