crabouflage

Crates.iocrabouflage
lib.rscrabouflage
version0.1.1
created_at2025-08-18 20:14:48.404165+00
updated_at2025-08-18 22:35:32.723458+00
descriptionHide arbitrary data in your .png files, through steganography.
homepage
repositoryhttps://github.com/mateiash/crabouflage
max_upload_size
id1801013
size106,155
David Andrei MateiČ™ (mateiash)

documentation

README

crabouflage

Crates.io

                           dP                         .8888b dP                            
                           88                         88   " 88                            
.d8888b. 88d888b. .d8888b. 88d888b. .d8888b. dP    dP 88aaa  88 .d8888b. .d8888b. .d8888b. 
88'  `"" 88'  `88 88'  `88 88'  `88 88'  `88 88    88 88     88 88'  `88 88'  `88 88ooood8 
88.  ... 88       88.  .88 88.  .88 88.  .88 88.  .88 88     88 88.  .88 88.  .88 88.  ... 
`88888P' dP       `88888P8 88Y8888' `88888P' `88888P' dP     dP `88888P8 `8888P88 `88888P' 
                                                                              .88          
                                                                          d8888P

Hide data in your images (.png files), through the amazing art of steganography.

Usage example

crabouflage embed image.png homework output.png

This command will embed the file homework into the contents of image.png and save the output to output.png.

Later, if you wish to extract the embedded file from the resulting image, you can run:

crabouflage extract output.png .

This command will extract the file previously embedded in the output.png image into a file(with the same name it had before being embedded) in the current directory.

Alternatively, if you wanted to extract with a different file name, you could run:

crabouflage extract output.png nosus

Which would extract into a file with the name nosus

How does it work?

Say your file is an arbitrary stream of bytes:

01100011 01100001 01110100

Most .png files will represent a pixel with 4 channels of bit depth of 8, meaning each pixel is represented by 4 bytes, for example:

01100011
01110010
01100001 
01100010

If you wanted to hide the first byte of your file(01100011) in this pixel, you could erase the least significant bits from each byte, and replace them with the bits of your file byte:

011000 01
011100 10
011000 00
011000 11

Then repeat! This is the base idea of this program. The first 4 encoded bytes are an unsigned 32bit int representing the length in bytes of the file contents, the next 2 bytes represent the length in bytes of the title. After that, there are two arrays encoded, one for the file content, and another one for the title. The rest of the image is left untouched.

Instalation

Clone and run in the repo directory:

cargo install --path .

Or, via crates.io:

cargo install crabouflage

Try it out by downloading and extracting from this image!

Camouflaged ferris

Commit count: 0

cargo fmt