Corrupting Images by Editing Encrypted Data

Corrupting Images by Editing Encrypted Data

Lately I was editing some images and I found out that it is possible to open up raw image data in a text editor. I opened an image in the open source text editor Notepad++, and found thousands of lines of encrypted image data. I found that by editing or erasing different parts of the file, I could corrupt and alter the image in different ways. I downloaded some more images from Pixabay, an excellent free stock image site (I wasn’t paid to say that), and got to work. I right-clicked on each image and clicked “Edit with Notepad++” to open the file and began removing random portions of the image data. Some parts of the image (especially near the beginning) could not be removed without preventing the image from being viewed or opened. It was a process of trial and error, but removing other sections produced interesting cuts and colors in the image. When I did this, I was cutting data out of the image, which meant it was filled in by looping other portions of the image. Deleting this data also meant that the color was altered from that point in the image on. The further down in the file that I made the edit, the further down in the image a cut was made. The more data I cut out, the more was missing from the edited image. These are the results (before corruption is on the left and after corruption is on the right, but hopefully that’s obvious):

 

Air bubbles in blue-green water.          Corrupted photo of air bubbles in blue-green water.

A tree in a field, with the sun behind it.          A corrupted image of a tree in a field, with the sun behind it.

A pile of several dollar bills.          Corrupted image of a pile of several dollar bills.

A computer screen displaying a graph.          Corrupted image of a computer screen showing a graph.

 

If you want to do this for yourself, make sure that you are very careful about which files you are editing (you don’t want to accidentally corrupt the wrong file). It is also worth noting that you don’t need to download Notepad++ to do this. You can use another text editor, or even just Notepad, which is included in the Windows operating system. Just right click on your image and go to “Open with”, then “Choose default program. . .”, then “Browse. . .” and enter into the file bar “%windir%\system32\notepad.exe,” or whatever your default Notepad directory is. I found this experiment/project quite interesting, and I hope you did too.

 

Image sources:

https://pixabay.com/en/apple-fruit-autumn-apfelernte-871316/
https://pixabay.com/en/air-bubbles-diving-underwater-blow-230014/
https://pixabay.com/en/tree-dawn-nature-bucovina-romania-338211/
https://pixabay.com/en/money-dollars-bills-cash-currency-2250365/
https://pixabay.com/en/computer-summary-chart-business-767776/