hide tar file in png

我只是一个虾纸丫 提交于 2019-12-08 11:59:11

问题


Can I simply embed tar file inside png image? I`m tried cat file.tar image.png > secret.png, but this not working for me. does have anybody working example? it would be preferable in ruby or python


回答1:


For simplicity's sake, you can use the stepic library.

It will do what you want out of the box:

 stepic --encode --image-in=plain.png --data-in=data.tar --out=secret.png

to decode:

 stepic --decode --image-in=secret.png --out=data.tar

You can download and install from the stepic webpage

I doubt you're going to be using this for life-critical data, but just in case:

Encrypt the data first!

It's somewhat trivial to recover ordered data from an image using image processing techniques. What you're encoding in the image should have the following properties to keep you safe and to be difficult to discover:

  1. Be cryptographically secure
  2. Be indistinguishable from random noise (see 1.)
  3. Be large enough that all the pixel of the image carry the encrypted data

The reason we do the last one is because it is very easy to detect if the encoded data stops half way down the image. You'll have an image where half has high noise, and half doesn't. In some cases, this is visible to the naked eye, let alone to someone who knows what they're doing.

I don't know if stepic does all this. Rely on it at your own risk.



来源:https://stackoverflow.com/questions/15642361/hide-tar-file-in-png

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!