Question: exercise ( ) : Encrypting Text with a Substitution Cipher Write a C program substitution.c which reads characters from its input and writes the characters

exercise () :
Encrypting Text with a Substitution Cipher
Write a C program substitution.c which reads characters from its input and writes the characters to its output encrypted with a Substitution cipher.
A Substitution cipher maps each letter to another letter.
The mapping will be given to your program via the command line as a command line argument (no spaces betweenany characters). This is all on one line. This input will contain 26 characters: an ordering of the letters 'a'..'z'.
Characters other than letters should not be encrypted.
Your program should stop only at the end of input.
Your program should contain at least one function other than main.
Examples
dcc substitution.c -o substitution
./substitution qwertyuiopasdfghjklzxcvbnm
Enter text:
I was scared of dentists and the dark
O vql leqktr gy rtfzolzl qfr zit rqka
I was scared of pretty girls and starting conversations
O vql leqktr gy hktzzn uoksl qfr lzqkzofu egfctklqzogfl
./substitution abcdefghijklmnopqrstuvwxyz
Enter text:
The identity cipher!!!
The identity cipher!!!
./substitution bcdefghijklmnopqrstuvwxyza
Enter text:
The Caesar cipher is a subset of the substitution cipher!
Uif Dbftbs djqifs jt b tvctfu pg uif tvctujuvujpo djqifs!
Your program will only be tested with an appropriate and valid mapping input for marking - but a good programmer would check the input is present and appropriate.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!