whisp is a modern C++ command-line application for hiding and extracting files inside image files using steganography techniques. It supports both RGB LSB encoding and alpha-channel encoding, and uses a clean modular design with support for unit testing, logging, and rich CLI parsing.
- 🔐 Hide any file inside PNG or BMP images
- 🎨 Two encoding methods:
- LSB in RGB channels (1/2/4 bits configurable)
- Alpha channel embedding
- 🧠 Automatic decoding using embedded metadata
- 🧪 Written in modern C++ with clean code and unit tests
- 📦 Uses libraries:
gtest,CLI11,CImg,spdlog - 📦 Dependency management via vcpkg
This project uses vcpkg to manage dependencies. The toolchain file is already integrated via CMake presets.
You can find the preset toolchain settings in:
cmake/presets/toolchains/vcpkg.json
This project uses CMake Presets and Ninja Multi-Config. You can configure and build the project as follows:
cmake --list-presetscmake --preset <PRESET_NAME>cmake --build --preset <PRESET_NAME> --target <TARGET>whisp encode --image-file input.png --secret-file secret.txt rgb --bits 2--bitscan be1,2, or4
whisp encode --image-file input.png --secret-file secret.txt alphaThe output will be saved as:
encoded_input.png
🕵️ Decode a hidden file from an image
whisp decode --image-file encoded_input.pngThe tool will detect the encoding method and extract the hidden file.
To run unit tests:
cmake --build --preset <PRESET_NAME> --target whisp_tests
ctest --preset <PRESET_NAME>You can enable advanced tooling and analysis with the following options when configuring with CMake:
-DCLANG_TIDY_ENABLE=ON– Enables clang-tidy analysis on all targets-DSANITIZERS_ENABLE=ON– Enables runtime sanitizers (ASan, UBSan, etc.)-DCOVERAGE_ENABLE=ON– Enables code coverage for unit tests and adds acoveragetarget
🧪 Note: Coverage collection currently works only with GCC.
You can use the following CMake presets depending on your compiler:
x64-linux-clang-*– For building with Clangx64-linux-gcc-*– For building with GCC
Use these presets with the --preset flag during configuration and build steps.
- For RGB LSB, the tool stores bits of the file into the least significant bits of the image's channels.
- For Alpha, it stores data directly into the alpha channel of the image.
- A small header is embedded into the image to identify the method and bit-depth used, which allows correct decoding.
MIT License