Unofficial implementation of the data compression algorithm described in the research paper by Zirra Peter Buba & Gregory Maksha Wajiga (2011).
This implementation provides a lossless data compression algorithm that combines factorization techniques with cryptographic properties. The algorithm encodes messages into a compressed form with fewer characters while simultaneously providing a level of data security.
- Lossless compression
- Built-in data security through encoding
- Separate compression and decompression keys
- Support for all printable ASCII characters
- Dual purpose: compression and basic encryption
The compression process works through the following steps:
- Serialization: Each character in the input string is assigned a numerical position
- Character Analysis: For each unique character, calculate:
- Count of occurrences
- Locations where it appears
- Product of all locations
- Sum of all locations
- Maximum location
- Compression: Generate compressed output using only unique characters
- Key Generation: Create decompression key using character metrics
The decompression process involves:
- Using the decompression key to reconstruct character positions
- Factorization of location products
- Verification against sums and maximum locations
- Character placement in original positions
Available in two programming languages:
- C implementation (
radical_compression.c
) - Python implementation (
radical_compressor.py
)
# Python
compressor = RadicalCompressor()
text = "WHO IS PROMISSING WHO"
compressed, encoding_table = compressor.compress(text)
decompressed = compressor.decompress(compressed, encoding_table)
To run:
python radical_compression.py
// C
const char* text = "WHO IS PROMISSING WHO";
EncodingTable table = compress(text);
char* decompressed = decompress(&table);
To compile and run:
gcc radical_compression.c -o radical_compression
./radical_compression
⬤ (base) ➜ radical-compression gcc radical_compression.c -o radical_compression ./radical_compression Original text length: 21 Compressed text length: 11 Compression ratio: 52.38% Successful roundtrip: Yes Original text: WHO IS PROMISSING WHO Compressed chars: WHO ISPRMNG Decompressed text: WHO IS PROMISSING WHO
As noted in the original paper:
- The decompression key should be transmitted through a separate channel (email, SMS)
- The algorithm provides basic security through obscurity of the compressed output
- The scheme is primarily designed for compression with added security benefits
- Not intended as a standalone cryptographic solution
The algorithm provides:
- Text size reduction through elimination of repeated characters
- Additional storage overhead for encoding table
- O(n) compression time complexity
- O(n*m) decompression time complexity (where m is the number of factors)
- Compression ratio depends heavily on character repetition
- Encoding table must be transmitted separately
- Not optimized for very large text files
- Limited cryptographic strength compared to modern standards
"This work deals with encoding algorithm that conveys a message that generates a 'compressed' form with fewer characters only understood through decoding the encoded data which reconstructs the original message. The proposed factorization techniques in conjunction with lossless method were adopted in compression and decompression of data for exploiting the size of memory, thereby decreasing the cost of the communications. The proposed algorithms shade the data from the eyes of the cryptanalysts during the data storage or transmission."
Zirra Peter Buba & Gregory Maksha Wajiga (2011). Radical Data Compression Algorithm Using Factorization.
International Journal of Computer Science and Security (IJCSS), Volume (5) : Issue (2) : 2011, 221-226.
DOI: N/A
ResearchGate: https://www.researchgate.net/publication/228872518_Radical_Data_Compression_Algorithm_Using_Factorization
This implementation is provided for educational and research purposes. Please refer to the original paper for any usage restrictions.
Original Paper Authors:
- Zirra Peter Buba (Adamawa State University)
- Gregory Maksha Wajiga (Federal University of Technology)
Implementation based on the published algorithm in the International Journal of Computer Science and Security (IJCSS), Volume (5) : Issue (2) : 2011.