Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Code in C language please help Exercise 5.9. Write a program, called hide, according to the following spec- ification: (1) It has two possible arguments:
Code in C language please help
Exercise 5.9. Write a program, called hide, according to the following spec- ification: (1) It has two possible arguments: -encrypt indicates encryption mode, while -decrypt indicates decryption mode. (2) It reads an arbitrary list of strings from stdin. (3) It applies a cypher to the strings. You may invent your own, but a simple one is to shift the letters by a constant amount (for example, 'a' becomes d', and 'z' becomes 'c'). It either encrypts or decrypts the strings ("shifts" or "deshifts" the letters) depending on the mode. (4) It prints the encrypted or decrypted text to stdout. At minimum, it should be able to handle text consisting only of lowercase letters. For example, if the message attention home planet stop prepare invasion stop earth is ripe for the taking stop cu soon full stop is in file msg.txt, then s/hide-encrypt msge.txt would produce the following cyphertext in file msge.txt if hide is using a shift of 12: mffqzfuaz tayq bxmzqf efab bdqbmdq uzhmeuaz efab qmdft ue dubq rad ftq fmvuzs efab og eaaz rgxx efab Then s/hide -decryptStep 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