Implement simple stream-cipher symmetric encryption/decryption algorithm, and encode the encrypted text into a "blank" text file.
Change into the the project root directory, and then type the following commands in the terminal:
mkdir build
cd build
cmake ..
make
Thereafter the binary executable can be found at build/bin/blank_encrypt
.
In Visual Studio Community, exclude the source file src\product\ascii_prn.cc
from build.
Place the built binary executable in a standalone directory/folder.
./blank_encrypt -g newkey.txt -e -i dummyin -o dummyout
blank_encrypt.exe -g newkey.txt -e -i dummyin -o dummyout
Replace the unencrypted.txt
and encrypted.txt
with your file names in the following commands in this section.
./blank_encrypt -k newkey.txt -f -e -i unencrypted.txt -o encrypted.txt
blank_encrypt.exe -k newkey.txt -f -e -i unencrypted.txt -o encrypted.txt
Replace the encrypted.txt
and decrypted.txt
with your file names in the following commands in this section.
./blank_encrypt -k newkey.txt -f -d -i encrypted.txt -o decrypted.txt
blank_encrypt.exe -k newkey.txt -f -d -i encrypted.txt -o decrypted.txt
Run the built executable with the flag -h
to see a description of the input arguments. Following is a snapshot
Usage: blank_encrypt.exe [OPTIONS]
Options:
-h,--help Print this help message and exit
-e,--encrypt Perform encryption.
-d,--decrypt Perform decryption.
-i,--input TEXT Specify the input file name
-o,--output TEXT Specify the output file name
-g,--generateKet TEXT Generate an encryption key and store it in the specified directory
-k,--key TEXT Specify the encryption key in hexadecimal format
-n,--notsequential Do not process sequentially
-f,--flush Flush output file