This project is an implementation of Deflate (i.e., LZ77 and Huffman Coding) Encoding Algorithm and Caesar Cipher Algorithm for text input files.
This is a cmake project. You can either run the cmake yourself or
run make
. Running make
will put the resulting binary
in build/bin
folder. The name of the resulting binary is
deflate_caesar
.
You can compress and decompress text input files with Deflate with this project. This algorithm uses LZ77 and Huffman Coding algorithms respectively and produces a smaller size output file which can be recovered later.
The commands for these operations are:
deflate_caesar compress <input file> <output file>
and
deflate_caesar decompress <input file> <output file>
An example would be:
deflate_caesar compress input.txt out_compress.txt
deflate_caesar decompress out_compress.txt out_decompress.txt
and the contents of input.txt
and out_decompress.txt
files
would be the same.
You can encrypt and decrypt text input files with Caesar Cipher with this project.
The commands for these operations are:
deflate_caesar encrypt <input file> <output file> <kNum>
and
deflate_caesar decrypt <input file> <output file> <kNum>
which <knum>
is the shift value of the Caesar algorithm
(e.g., if the characters is a
, and kNum
is 1
,
the resulting character would be b
, whose ASCII Code
is kNum
more).
An example would be:
deflate_caesar encrypt input.txt out_encrypt.txt 4
deflate_caesar decrypt out_encrypt.txt out_decrypt.txt 4
and the contents of input.txt
and out_decrypt.txt
files
would be the same.
You can combine the above operations as well.
This time the text file would get compressed first,
and get encrypted afterward.
The commands for these operations are:
deflate_caesar compress_encrypt <input file> <output file> <kNum>
and
deflate_caesar decrypt_decompress <input file> <output file> <kNum>
An example would be:
deflate_caesar compress_encrypt input.txt out_coenc.txt 4
deflate_caesar decrypt_decompress out_coenc.txt out_decdec.txt 4
and the contents of input.txt
and out_decdec.txt
files
would be the same.