Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your task will be to create a C program that can encrypt and decrypt using a substitution cipher. Your program should ask for a mode

image text in transcribed

Your task will be to create a C program that can encrypt and decrypt using a substitution cipher. Your program should ask for a mode (encrypt or decrypt), a text file containing the cipher, and string input (plain text if encrypting, cipher text if decrypting). The output should be the cipher text if encrypting or the plain text if decrypting. Additionally, you should ensure that your program is not case sensitive and validate the cipher file to ensure that it does not have duplicate mappings or incomplete mappings. Each letter must appear on the left-hand side exactly once and the right-hand side exactly once. The file format for the cipher file should be comma-separated values. There should be one rule per line and each begins with the letter being replaced, and ends with the letter replacing it. The above rules would be written in this format as: Requirements: - The input to your program must match what is listed in the description (mode, cipher file, string). You may either prompt or use CLI input (arguments to the exe) - Your program must not be case sensitive. 'hello', 'Hello', 'HELLO', and 'HeLlO' should all produce the same output, for example. - Your program must validate the structure of the cipher file and output with an appropriate error message if it is not followed. - A file with lines X,A and X,R should be rejected. - A file with the lines X,A and X,R should be rejected - A file with the lines X,A and D,a should be rejected - You may assume that input will only be single words - You do not need to consider whitespace, punctuation, or special symbols

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

Advances In Databases 11th British National Conference On Databases Bncod 11 Keele Uk July 7 9 1993 Proceedings Lncs 696

Authors: Michael F. Worboys ,Anna F. Grundy

1993rd Edition

3540569219, 978-3540569213

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago

Question

Does it use a maximum of two typefaces or fonts?

Answered: 1 week ago