Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 characters: an ordering of the letters az
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
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