Experimental toolkit for encoding and transporting binary data across constrained or filtered communication channels.
This repository explores how binary data (e.g. ZIP archives) can be transferred through channels that only allow text or heavily restricted file formats.
Instead of relying on traditional file transfer mechanisms, this project demonstrates how data can be:
- encoded into text representations
- transported through constrained environments
- reconstructed on the receiving side
It combines Python and Excel/VBA implementations to simulate real-world interoperability across heterogeneous systems.
In many real-world environments, direct binary file transfer is not possible.
Examples include systems where:
- only text fields are available
- file uploads are restricted or filtered
- data must pass through logging systems
- clipboard-only workflows are enforced
- legacy tools (e.g. Excel) act as data interfaces
- certain file types are blocked entirely
In these situations, binary data must be transformed into a text-compatible representation before it can be transported.
This project explores how such pipelines can be built in a:
- robust
- reproducible
- cross-platform
way — while staying compatible with constrained systems.
A streaming encoder/decoder that converts binary data into:
- Base64
- Hexadecimal
Features:
- streaming processing (handles large files)
- no inserted line breaks (channel-safe)
- tolerant decoding (handles noisy input)
- Python ↔ VBA compatibility
A format-aware embedding mechanism that:
- appends binary payloads to PDF files
- extracts embedded payloads reliably
- verifies integrity via CRC32
Concept:
ZIP → PDF (carrier) → ZIP
- Streaming Base64 / Hex encoding (no memory blowups)
- Excel VBA + Python interoperability
- PDF-based payload embedding with integrity checks (CRC32)
- Fully reproducible demo pipeline
- SHA-256 checksum validation for all artifacts
constrained-channel-lab/
├── python/ # Python CLI codec
├── vba/ # Excel VBA modules
├── samples/ # Input samples
├── demo_output/ # Generated demo artifacts
├── checksums/ # SHA256 verification
├── ConstrainedChannelLab_Demo.xlsm
└── generate_checksums.sh
-
Open:
ConstrainedChannelLab_Demo.xlsm -
Enable macros
-
Use the UI buttons:
- Encode ZIP → Text
- Encode Text → ZIP
- Embed ZIP into PDF
- Extract ZIP from PDF
- Select files from
/samples
This is the fastest way to explore the system end-to-end.
python python/channel_text_codec.py encode input.zip output.txt --mode base64
python python/channel_text_codec.py decode output.txt reconstructed.zip --mode base64
--mode hex
Import modules into Excel:
ChannelTextCodec.basPdfCarrierCodec.bas
Steps:
- Open Excel VBA Editor (
ALT + F11) - Import
.basfiles - Run macros or connect them to UI buttons
ZIP → Base64 TXT → ZIP
ZIP → Embedded into PDF → Extracted ZIP
Pre-generated outputs are available in:
/demo_output/
To ensure reproducibility and integrity:
bash generate_checksums.sh
Output:
checksums/SHA256SUMS.txt
This allows you to verify that:
- encoded/decoded files are identical
- pipelines behave deterministically
- demo artifacts are reproducible
The project was built with the following goals:
- compatibility across languages (Python ↔ VBA)
- streaming processing for large files
- tolerance for noisy or lossy text channels
- minimal dependencies
- clear and inspectable implementation
Constrained data channels appear in many areas of systems engineering and cybersecurity:
- restricted enterprise environments
- incident response setups
- malware analysis labs
- embedded debugging pipelines
- legacy infrastructure
Understanding how data can be:
- encoded
- transported
- reconstructed
across such channels is a valuable engineering skill — both for defensive and analytical purposes.
Binary File
↓
Encoding (Base64 / Hex)
↓
Constrained Channel (Text-only)
↓
Decoding
↓
Original File
This project is intended for educational and experimental purposes only.
Do not use it to bypass organizational policies or exfiltrate sensitive data.
Luka Petrovic