0

I am doing a small program about using an image to calculate the Message digest, but what i also need to do is i need to put the another image into this original image, and put this modified image (original image embed by another image) to cloud. There is my question that if i tried to download this modified image from cloud, and any way i can remove image which was embeded into original image, and using this original image to calculate to get Message digest the same as the original Message digest???

There are two ways i was trying to do, and i drew it through paper(maybe easy to understand what i am trying to say) below

Method 1

Method 2

Jarek Huang
  • 119
  • 3
  • 17
  • If you store your image lossless (PNG, TIFF or similar), and you create the digest based on the pixel values, rather than file contents, your method 2 at least *could* work in theory. It will not work with lossy storage. It will most likely not work comparing files either, unless you fully control the writing process, and make sure you write the exact same bytes to file for equal images. – Harald K Jan 09 '14 at 09:14
  • I was afraid the message digest will be different between before and after the image cut. Thank you for your help. – Jarek Huang Jan 09 '14 at 17:44
  • It looks like the message digest are difference before and after image crop. – Jarek Huang Jan 13 '14 at 20:08
  • Yes, of course. But in your "Method 2", you seem to do the same "crop" (which is really painting an area black) both in step 1 and and step 2. The whole point of a digest is to detect if something is modified, so if you want the same digest, you obviously need to make the exact same modifications in both cases... Otherwise it will not (and should not) match. – Harald K Jan 13 '14 at 20:17
  • But i thought i make the same modification in both image. Crop left-buttom corner from original image and put it back as the original one, and then i do the same thing as the first time to crop left-buttom corner from original image (it original image was cut once). So i thought these two images(with crop left-buttom corner) will have the same message digest. Please let me know if i am wrong. Thank you for your help, HaraldK – Jarek Huang Jan 13 '14 at 20:51
  • Sorry, i forgot to change one of the format in the code. If i am doing with image lossless, the image files and message digests will be fine. Thank you. – Jarek Huang Jan 13 '14 at 21:47

0 Answers0