Answered step by step
Verified Expert Solution
Question
1 Approved Answer
must be done in c++ Introduction The Caesar cipher is a substitution cipher where each letter in the original message (called the plaintext) is replaced
must be done in c++
Introduction The Caesar cipher is a substitution cipher where each letter in the original message (called the plaintext) is replaced with a letter corresponding to a certain number of letters up or down in the alphabet. The encrypted message (ciphertext) is not easily readable. For example, here's the Caesar Cipher encryption of a message, using a left shift of 3. Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD It is straightforward to recover the original message by using the opposite shift. Task 1 (Weightage 25%) You are asked to write a program that takes a shift value between +/- 26 and a plaintext message (no spaces) and returns the corresponding ciphertext. The program should also implement a decryption routine that reconstructs the original plaintext from the ciphertext Example usage $ ./caesar Enter shift +/- 26: -3 Enter plaintext message (A-Z only, no spaces): THE ciphertext: QEB plaintext: THE or or $ ./caesar Enter shift +/- 26: 1 Enter plaintext message (A-Z only, no spaces): 222 ciphertext: AAA plaintext: 222 We assume that the user message only consists of uppercase English alphabet (A-2). Task 2 (Weightage 25%) You are now to extend the above program to take as inputs files. The program should be able to read a file and encode or decode it as needed For the sake of simplicity, we assume that you only need to change letters [A-Z] in the file. You can safely ignore other letters in the file (i.e., keep those as is.) Encrypting a file to cyphertext Encrypt a file in.txt containing plaintext to a file out.txt containing ciphertext using shiftStep 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