A C++ CLI-based compression tool with built-in encryption, metadata handling, and support for binary files.
- β C++17 compiler (e.g., g++ or clang++)
- β
nlohmann files
- π Place the file in the same directory as this tool (\nlohmann)
Optional (for large files):
- β 16GB+ RAM recommended
- β 64-bit OS
Compile using g++:
g++ main.cpp -std=c++17 -o main./main- π Username: admin
- π Password: admin123
- [1] Compress
- [2] Decompress
- π‘ This is used for encryption and decryption. Use the same key to decompress later.
- π Input: any file (TXT, CSV, JSON, BIN, PDF, etc.)
- π You'll be asked:
- File path
- Compression method: "huffman" or "shannon"
- β
Output:
- Compressed binary:
<filename>.bin - Metadata:
<filename>.meta
- Compressed binary:
- π Required:
- Same XOR key used during compression
- Original file name (e.g., "sample.csv")
- β
Output:
- Restored file written as original (e.g., "sample.csv")
- DO NOT delete the .meta file β it's required for decompression.
- The XOR key must be remembered β there's no recovery mechanism.
- Large files (1GB+) may take time depending on system resources.
- Make sure you're using the correct XOR key.
- Ensure the JSON metadata and binary file are not corrupted or renamed.
- Run in a terminal/console that supports UTF-8 characters.