Pngme
Encode and decode hidden messages in PNG files.
Introduction
This is an intermediate level personal project that I tackled in order to reinforce my knowledge of the Rust programming language. It was somewhat tough but it helped me a lot to get my feet more wet at writing a little more Rust and reading some official documentation.
This is my implementation or solution of this project but it is somewhat popular online, you can find it at Pngme. Taken from the text:
“I just finished reading The Book. What should I do next?”
This question comes up weekly in online Rust discussions. The answers to this question are always “Make something!”, sometimes followed by a list a cool projects. This is a great answer for some people, but others might be looking for a little more direction. This guide is intended to fill the gap between heavily directed beginner tutorials and working on your own projects. The primary goal here is to get you writing code. The secondary goal is to get you reading documentation.
The idea is to learn about and work around with the PNG specification, in order to manipulate the chunks of a given PNG image. This way, we can store text messages hidden inside a seemingly normal picture.
The project is divided in four main sections or chapters:
- Chunk Types
- Chunks
- PNG Files
- Command Line Arguments.
This approach helps the student to tackle problems one step at a time. Also, the author provides a basic skeleton to follow, along with his predefined tests.
I have to admit, this was tough. The first time I tried to implement this project, it really boggled my mind. But I came back some weeks later with a little more peace of mind and managed to slowly, but surely, complete it.
Installation
|
|
Then you can run the executable via:
|
|
Or you can install globally so you can run it from anywhere:
|
|
Usage
Run without any arguments to get a list of possible commands:
|
|
- Commands:
- encode
- decode
- remove
- help
Run a command without additional arguments to get a list of the needed options:
|
|
Encoding a message in a PNG file:
|
|
Decoding a message in a PNG file:
|
|
This would print:
|
|
As this was implemented while I was learning Rust, I think it has some ugly and likely unoptimized code, so I decided to try to implement it again, just as a learning reinforcement: Github