Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

CLI tool to encode messages in PNG files.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

SanchithHegde/png-message-encode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PNG Message Encode

My implementation of picklenerd/pngme_book (rendered book), for educational purposes.

Table of Contents

Installation

To build this project from source, you need Rust 1.40 or higher. Refer to the docs for more information on installing Rust.

You can then use cargo to build everything:

git clone https://github.com/SanchithHegde/png-message-encode
cd png-message-encode
cargo install --path .

Usage

Encode a message into a PNG file

$ pngme encode
pngme-encode
Encode a message in a PNG file

USAGE:
    pngme encode [FLAGS] <in-file> <chunk-type> <message> [out-file]

ARGS:
    <in-file>       Path to the PNG file to encode the message in
    <chunk-type>    A 4-character long ASCII alphabetic string
    <message>       Message to encode
    <out-file>      Path to the PNG file to save the encoded image as. Optional. If this is not
                    specified, the input PNG file is updated in place

FLAGS:
    -h, --help       Prints help information
    -v, --verbose    Prints verbose information
    -V, --version    Prints version information

So, you'd run:

pngme encode /path/to/image.png teXt "This is a secret message!"

Alternatively, if you want the encoded image to be stored as a separate file, you'd run:

pngme encode /path/to/image.png teXt "This is a secret message!" /path/to/image_out.png

Decode a message stored in a PNG file

$ pngme decode
pngme-decode
Decode a message in a PNG file

USAGE:
    pngme decode [FLAGS] <in-file> <chunk-type>

ARGS:
    <in-file>       Path to the PNG file to decode the message from
    <chunk-type>    A 4-character long ASCII alphabetic string

FLAGS:
    -h, --help       Prints help information
    -v, --verbose    Prints verbose information
    -V, --version    Prints version information

So, you'd run:

$ pngme decode /path/to/image.png teXt
This is a secret message!

Remove a message from a PNG file

$ pngme remove
pngme-remove
Remove a message from a PNG file

USAGE:
    pngme remove [FLAGS] <in-file> <chunk-type>

ARGS:
    <in-file>       Path to the PNG file to remove the message from
    <chunk-type>    A 4-character long ASCII alphabetic string

FLAGS:
    -h, --help       Prints help information
    -v, --verbose    Prints verbose information
    -V, --version    Prints version information

So, you'd run:

pngme remove /path/to/image.png teXt

Print a list of PNG chunks that can be searched for messages

$ pngme print
pngme-print
Print a list of PNG chunks that can be searched for messages

USAGE:
    pngme print [FLAGS] <in-file>

ARGS:
    <in-file>    Path to the PNG file to list all chunks

FLAGS:
    -h, --help       Prints help information
    -v, --verbose    Prints verbose information
    -V, --version    Prints version information

So, you'd run (provided there's a teXt chunk added to the image):

$ pngme print /path/to/image.png
PNG chunks found in file '/path/to/image.png':

teXt

Running tests

cargo test

License

Dual licensed under Apache 2.0 or MIT at your option.

See the LICENSE-APACHE and LICENSE-MIT files for license details.

About

CLI tool to encode messages in PNG files.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Languages