C++代写|C代写|算法: 这是一个通过C++实现一个加密解密算法的编程联系题目
Book Cipher
Course INFO- 1156 Object-Oriented Programming in C++
Project Description
Create two C++ console applications; one that encodes a text message using a bookcipher, and another that decodes the message coded by the previous program.
Program Interfaces
The encoder should have the following command-line interface:
bcencode.exe bookfile messagefile codedfile
The decoder should have the following command-line interface:
bcdecode.exe bookfile codedfile messagefile
Where:
- bookfile is the name of the ASCII text file containing the book used toencode/decode the message.
- messagefile is the name of the ASCII text file containing the message to beencoded
- codedfile is the name of the ASCII text file containing the offset numbers
Encoding rules
Encode each character of the source file by replacing it with two numbers, the firstrepresenting the line in the book (zero-based), and the second the offset to that characterin that line (also zero-based). Any method of choosing which offset to use is acceptableso long as the same offset isnt used repeatedly.At the end of running bcencoder, a codedfile is created with offsets.At the end of running bcdecoder, a messagefile is created with the message.
The encoded file must be just a file of the exact offsets of the message file.bookfile: ABCDEFGHIJKLM\nNOPQRSTUVWXYZmessagefile: ACERcodedfile: 0x00000000 0 x00000000 0 x00000000 0x00000002 0x00000000 0x0000000 40×0000000 1 0x0000000 4
Encoding background
To read more about encoding messages using the book cipher see:
https://en.wikipedia.org/wiki/Book_cipherIn this program, you are encoding letters, not the words. The encoded file will store thenumber in binary.
bctest.exe
bctest.exe is a program that can perform some tests on your encoder and decoderprograms. The test program should be placed into the same folder as your executablefiles. If your programs are properly called bcencode.exe and bcdecode.exe the testprogram will automatically execute your programs at appropriate times during the test.
Grading Criteria
Functional Requirements
Encoder works 4 0% 40%Decoder works 4 0% 40%Both programs report errors if any of the input filescannot be opened (indicating which file was theproblem).
10% 10%
The encoder program reports and quits if the messagecannot be encoded by the book file (i.e. A character inthe message to be encoded does not exist in the bookfile), and reports which character cannot be encoded.
10% 10%
Non-functional requirements
Executables program are not named bcencode.exe andbcdecode.exe
- 10% / each
Coded message uses the same index repeatedly for thesame letter.
– 20%
Penalties from C & C++ Grading Guide v1.1. 0A guide to code/comment style can be found at C++ Style
Various
Late submission
- One to five days late
- More than five days late
- 10%/day
- 10 0%
- 10%/day