🕵️♂️ Stegano
🚀
stegano
: Stegano is a powerful and versatile steganography tool designed to empower you with a wide range of image manipulation and data encryption capabilities.
📖 Table of Contents
🚀 Installation
To install stegano
, use the following Cargo command:
🖼️ Features
- Parse both PNG and JPEG images effortlessly.
- Gain insights into the internal structure of PNG images with a hex dump view.
- Seamlessly inject payloads into images at the
IEND - 8
bytes position marker. - Safely hide your data without compromising the integrity of the original image.
- Utilize the AES-128 algorithm for secure encryption and decryption of hidden data.
- No limitations on the length of the payload that can be injected.
🛠️ Usage
stegano
provides three subcommands:
)
Use these subcommands to process and manipulate png and jpeg images. Here are some examples:
-
Read and process 10 chunks from a png image:
-
Process the png image in silent mode:
-
Read and process a jpeg image.
Sometimes the
JFIF
header doesn't exist, but it is still a valid jpeg file:$ stegano show-meta -i image_file_name -t jpeg DQT Header for Chunk#1: DqtHeader { dct: DctStruct { quantum: [[8, 2054, 1542, 1543, 1798, 1541, 1288, 2055, 1799, 1799, 1801, 2313, 2312, 2058, 2572, 3092, 5133, 3340, 3083, 2827, 2828, 3097, 6418, 4627, 4879, 3860, 5149, 7450, 6687, 7966, 7709, 7450, 6684, 7196, 7200, 8228, 9262, 11815, 10016, 8226, 8748, 11299, 8988, 7196, 7208, 10295, 14121, 10540, 11312, 12337, 12596, 13364, 13364, 13343, 7975, 10041, 14653, 15672, 14386, 12860, 15406, 11827, 13108, 13362], [12801, 265, 2313, 2313, 2316, 3083, 2828, 3096, 6157, 3341, 3352, 6194, 12833, 8476, 7201, 8498, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 12850, 0]] } } SOF Header for Chunk#3: SofHeader { jpeg_obj: JpegObj { precision: 8, image_height: 460, image_width: 460, number_of_components: 3, comp_id: [1, 2, 3], hsamp_factor: [2, 1, 1], vsamp_factor: [2, 1, 1], qtable_number: [0, 1, 1], dctable_number: [1, 2, 3], actable_number: [11, 12, 13, 14], ss: 0, se: 63, ah: 0, al: 0 } } Processing DHT Header for Chunk#4: SOS Header for Chunk#5: SosHeader { jpeg_obj: JpegObj { precision: 3, image_height: 460, image_width: 460, number_of_components: 3, comp_id: [17], hsamp_factor: [3], vsamp_factor: [15], qtable_number: [0], dctable_number: [0], actable_number: [0], ss: 0, se: 0, ah: 0, al: 0 } }
-
Read chunks at different positions:
# Read 1 chunk starting from position 0 | | | | ; | | | |
-
Encrypt and inject data in an image:
[!NOTE] Stegano automatically identifies the location of the
IEND
marker in a PNG image and injects the payload at a position 8 bytes before the IEND marker by default. This is done to prevent any corruption of the original image.
[!NOTE] By default, the maximum key length is restricted to 16 characters.
-
Using the previously obtained offset, you can decrypt and extract the secret information from an image, as well as remove the secret content from the image:
-
if wrong key is provided:
-
if wrong key and wrong offset are provided:
-
if correct key and wrong offset are provided:
| | (
[!NOTE] By default, Stegano uses the AES-128 encryption algorithm. The maximum key length supported is 16 characters. If you provide a longer key, it will be automatically padded or truncated to fit the required length.
🎨 Options
Option | Description |
---|---|
Encryption Options | |
-a or --algo |
Sets the algorithm for encryption (default is "aes"). |
-i or --input |
Sets the input file for encryption. |
-o or --output |
Sets the output file for the encrypted payload (default is "output.png"). |
-k or --key |
Sets the key for payload encryption (default is "key"). |
-s or --suppress |
Suppresses output messages. |
-f or --offset |
Sets the offset (default is 9999999999 for auto injection: IEND - 8 bytes). |
-p or --payload |
Sets the payload (default is "hello"). |
-t or --type |
Sets the type (default is "PNG"). |
Decryption Options | |
-a or --algo |
Sets the algorithm for decryption (default is "aes"). |
-i or --input |
Sets the input file for decryption. |
-o or --output |
Sets the output file for the decrypted payload (default is "output.png"). |
-k or --key |
Sets the key for payload decryption (default is "key"). |
-s or --suppress |
Suppresses output messages. |
-f or --offset |
Sets the offset (default is 9999999999) for auto decryption: IEND - 8 bytes). |
-p or --payload |
Sets the payload (default is "hello"). |
-t or --type |
Sets the type (default is "PNG"). |
Metadata Options | |
-i or --input |
Sets the input image file for metadata extraction. |
-n or --nb-chunks |
Read a specific number of chunks (default is 100). |
-s or --start |
Sets the index of the start chunk to read from (default 0). |
-e or --end |
Sets the index of the end chunk to stop reading at (default 100). |
-r or --suppress |
Suppresses output messages. |
-z or --read-end |
Read from start or end of file (default is reading from the start of image). |
🤝 Contributing
Contributions and feedback are welcome! If you'd like to contribute, report an issue, or suggest an enhancement, please engage with the project on GitHub. Your contributions help improve this crate for the community.
📄 License
This project is licensed under the MIT License.