lllloda / blank_encrypt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blank-Encryption Project

Implement simple stream-cipher symmetric encryption/decryption algorithm, and encode the encrypted text into a "blank" text file.

How To Build

On Ubuntu 22.04

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.

On Windows 11

In Visual Studio Community, exclude the source file src\product\ascii_prn.cc from build.

Quick Start

Place the built binary executable in a standalone directory/folder.

Generate Encryption Key

On Ubuntu 22.04

./blank_encrypt -g newkey.txt -e -i dummyin -o dummyout

On Windows 11

blank_encrypt.exe -g newkey.txt -e -i dummyin -o dummyout

Peform Encryption

Replace the unencrypted.txt and encrypted.txt with your file names in the following commands in this section.

On Ubuntu 22.04

./blank_encrypt -k newkey.txt -f -e -i unencrypted.txt -o encrypted.txt

On Windows 11

blank_encrypt.exe -k newkey.txt -f -e -i unencrypted.txt -o encrypted.txt

Perform Decryption

Replace the encrypted.txt and decrypted.txt with your file names in the following commands in this section.

On Ubuntu 22.04

./blank_encrypt -k newkey.txt -f -d -i encrypted.txt -o decrypted.txt

On Windows 11

blank_encrypt.exe -k newkey.txt -f -d -i encrypted.txt -o decrypted.txt

Input Arguments

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

About


Languages

Language:C++ 98.6%Language:Python 1.0%Language:CMake 0.3%Language:Makefile 0.1%