Skip to content

This project is an implementation of Deflate (i.e., LZ77 and Huffman Coding) Encoding Algorithm and Caesar Cipher Algorithm for text input files.

Notifications You must be signed in to change notification settings

arianhaddadi/Text-Compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Compressor & Encoder

This project is an implementation of Deflate (i.e., LZ77 and Huffman Coding) Encoding Algorithm and Caesar Cipher Algorithm for text input files.

How to build

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.

Operations

Codec

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.

Encryption/Decryption

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 offset number that all characters would get shifted as much (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.

Codec & Encryption/Decryption

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.

About

This project is an implementation of Deflate (i.e., LZ77 and Huffman Coding) Encoding Algorithm and Caesar Cipher Algorithm for text input files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published