Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

People Have Had The Need To Enctypt Information As Far Back As The Time Of The Roman Emperor Julius Caesar, And Possibly Before. One Of

People Have Had The Need To Enctypt Information As Far Back As The Time Of The Roman Emperor Julius Caesar, And Possibly Before. One Of The Simplest Cryptosystems We Know Today, The Caesar Cipher, Bears His Name. For Example, The Encrypted Message \"KHOOR\" Makes No Sense At Face Value, But If We Know The Decryption Key, Which Is 3, Then We Can Decode The

there is a RandomSupport.h file that you can use in your projects to generate random integers. The way it works is when you include it in your projects, you can create variables of type RNG , like this: RNG generator(1, 10); // Create a random number generator with limits 1, 10 (inclusive) 1 2 3 int x = generator.get(); // x will be a random integer between 1 and 10 There are also 2 complete C++ programs, namely encode.cpp and decode.cpp which rely on code in crypto.h (this is where you will be working). To run the encode program, you can build it and just run ./encode \"PLAINTEXT MESSAGE\" . The plaintext message is given as a command line argument. Make sure you put it in double quotes. The program should just produce a bunch of numbers, one on each line. You can store these in a file for convenience. To do that, just type ./encode \"PLAINTEXT MESSAGE\" > ciphertext.txt. The contents of ciphertext.txt will be large integers, one per line, as many lines as there are characters in the message. The decode program runs in a similar way. You just type ./decode and it will start asking you to enter numbers one at a time. When you are done entering the numbers, you can press Ctrl+D to tell the program you are done entering input. Instead of doing all that manually, you can feed the file you stored in the encoding phase via input redirection. To do that, you can use the command ./decode

1. Implement the encode function in crypto.h. It should take in a plaintext message as a string and encode it with the Kyrilov Cipher described above. The result should be returned as a vector of unsigned int. The encryption key should be hard coded as 3. You don't need to take it in as a parameter in the function. Make it always work with 3. 2. Implement the decode function in crypto.h. It should take in a vector of unsigned int which is the encoded message, and it should return a string , representing the plaintext. You can produce your own ciphertext files, but there is one included for you, which is message.txt. . 3. There is another encoded message in the file secret. txt. See if you can crack it. We do not provide a key, nor do we specify which cryptosystem is used to encode it, other than its name, which is the Kyrilov 2 Cipher. In the file q3. txt, on the first line write the decoded plaintext. Leave a blank line and explain how you cracked it. What did you start with, what you tried, what experiments you did. Describe everything you did, including code you ran in your attempts to crack it.

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

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions