User:J.smith/Image Commitment scheme

From Wikimedia Commons, the free media repository
Jump to: navigation, search
The first image to be protected under the Image Commitment scheme.

Commitment schemes are a very powerful way to maintain a unique identity in a pseudo anonymous environment. The idea is to use cryptographic hashes; you choose a secret string known only to yourself, put it through a one-way hash function, and publish the result somewhere. As the result is a hash, nobody can easily work backwards from the hash to the secret string; hence, if you give the secret string to someone and they hash it and the hash turns out to be the same as the one published, it is very strong evidence that the person giving the secret string is the same person who originally published the hash. An attacker compromising an account presumably would not know the secret string.[1]

This concept can be used to our advantage. Hash functions don't care what kind of data you feed them. The data could be a binary source, such as an image.

How would I protect an image?[edit]

This is the original image. I would keep this image hidden.
Cropped & compressed image. This is the image that I would publish.

Lets create a hypothetical situation. You just took this fine macro shot of a rock and you want to share it with the world. The first step is to save a copy of the original somewhere safe. Now, run a hash tool on that image. Save the hash for latter. On the copy your going to upload make some non-reversible change to the image. Cropping the picture is a good way to go since it's obvious what changes have been made. Make sure the change you make to the image is enough that it would be impossible to simply guess at what was removed. Now, upload the modified image and include the hash from the original image in the description.

In my example to the right I cropped 10 pixels from every side reducing the overall dimensions from 3,072 × 2,304 to 3,052 × 2,284. I also compressed the image about 50% in size. using MD5[2] the hash of the original image turns out to be 24baf6ff8272e351b5b58960b0b22951. For comparison, if I were to HASH the altered image, the result is very different: 3c28cc5c81f0af4248ddb50c74a9af99

Ok, so what? Why bother?[edit]

We are all here to help provide a free-image repository for the world. However, we as photographers have the right to be recognized for our effort. We also have the right to require some conditions on re-using our images. The only teeth that these requirements have is our ability to enforce the licenses thought he legal system. If we have no way to prove that we are the owner of an image then we lose the ability to keep the free-image movement free. Because of the shift into the digital age there no-longer exists a physical "negative" for each photo. That negative used to provide a hard evidence. An Image Commitment scheme provides us a tool to make up for that loss.

What hash should I use?[edit]

  • MD5 is flawed and isn't a very good choice for generating hashes.
  • SHA-1 is a good choice. It technically suffers from the same problem of Hash collision that MD5 has, but to a much more limited degree. It could take years of processing power to find a collision for a given Hash. SHA-2 should be much more secure, but it has not yet received the same scrutiny as SHA-1.
  • WHIRLPOOL - According to the Wikipedia article on WHIRLPOOL there are "no known security weaknesses." This would make this a very good choice.

Where do I get the tools?[edit]

  • md5deep is the tool I used in this example. Beyond md5, it offers SHA-1, SHA-2 (256 bit version), Tiger and WHIRLPOOL. This tool is command-line, but was easy to figure out.[1]
  • Jacksum is a platform independent java implementation of 58 different[3] hash functions including the ones mentioned here.
  • Help! - I am not able to find a tool with an easy-to-use GUI interface. If you know of one please list it here.
HashCalc is a software with a GUI interface with which it possible to obtain popular hash functions.



{{Image committed|24baf6ff8272e351b5b58960b0b22951|MD5}}

Committed Image
The uploader of this image has made changes to the image and has retained the original. Below is a MD5 hash of the original image provided in the event that the owner of the image might need to legally prove their ownership. Please see our description on how this process works and its purpose.


  1. This paragraph was lifted from wikipedia's template for user committed identities from this version.
  2. MD5 is considered flawed and may be vulnerable. See the MD5 article on Wikipedia for more information. However, it may be good-enough for this application because exploiting the flaws in the encryption algorithm may make the results appear tampered with. In any case, I recommend SHA or WHIRLPOOL for a more secure hash.
  3. For ease of use, please stick to the popular hash functions.