Answered step by step
Verified Expert Solution
Link Copied!

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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo

1st Edition

0763733148, 978-0763733148

More Books

Students also viewed these Databases questions

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago

Question

2. What is the meaning and definition of Banking?

Answered: 1 week ago