encode/decode any file into a PNG image and vice-versa
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.1 KiB

8 years ago
5 years ago
7 years ago
8 years ago
8 years ago
8 years ago
7 years ago
5 years ago
7 years ago
8 years ago
5 years ago
7 years ago
8 years ago
8 years ago
  1. Steganos
  2. =======
  3. The concept is easy and creative: get the data from the file, encode into base64, compact and encode it again into hexadecimal, then get each chunks of hexa values (ex: ff 12 d3) to compose the RGB pixels (ex: #ff12d3) that represents the data as an encoded PNG image in such a way that it can be reversed and decoded as the original file.
  4. This was a prove of concept written in Ruby (and parcially in Node.js) so I could upload 6GB of videos and PDFs to Flickr as images, and then get it back as the original files.
  5. [Julian Assange, Cypherpunks 6.3MB PDF as a decodable 4MB PNG]
  6. ![Julian Assange - Cypherpunks PDF](https://code.kripto.solutions/kripto/steganos/raw/branch/master/output-sample.jpg "Julian Assange - Cypherpunks PDF")
  7. Simple text encoding sample:
  8. ```
  9. "extrapolo".to_b64.compact.to_hex
  10. => "78da8b8ac83048ce752b4f32aa28e302001fbe0464"
  11. final 7 hexa color pixels to represent "extrapolo" data as image
  12. => #78da8b #8ac830 #48ce75 #2b4f32 #aa28e3 #02001f #be0464
  13. and back to the original data,
  14. "78da8b8ac83048ce752b4f32aa28e302001fbe0464".from_hex.unzip.from_b64
  15. => "extrapolo"
  16. ```
  17. More: http://en.wikipedia.org/wiki/Steganography