Image Encrypt
A program that encrypts text and stores it inside image pixel data using XOR or AES encryption.
image-encrypt
By Mark Narain Enzinger
Overview
This program can encrypt text and store it inside an image. It offers two encryption methods: XOR encryption and AES encryption. The text is stored inside the image by modifying the lowest byte of all three color channels (RGB) of each pixel.
| Bytes | Purpose |
|---|---|
| 32 | Length of the text that follows |
| text.len * 8 | All bits of the text |
| Remaining unused pixel bytes until img.len - 32 | Random bytes to fill the image |
| 32 | Checksum built from the image bytes before the checksum |
Currently, the user can choose between XOR-linking the text with a randomly generated 64-bit key or using 256-bit AES encryption.
I started this project to learn about cryptographic programming and figure out the BMP file format. I may return to it later to broaden my encryption and decryption knowledge.
You can try it under marknarain.com/apps/image-encrypt.
Used Libraries
- OpenSSL 3.0.13. A precompiled version is included in the Solution directory for Visual Studio 2022 and may not be compatible with other environments.
I downloaded OpenSSL from openssl.org. Installation instructions are included in INSTALL.md and NOTES-WINDOWS.md.
Used Environment
- Windows 11
- Visual Studio 2022 (17.9.3)
- Atlassian Sourcetree (optional)


Comments
0Loading comments...