Let say I have a large file that is of considerable interest to the public and I want to publish it. The plan is to hash it using reliable function and publish its hash on a public blockchain (btc or eth) to timestamp it. Then, encrypt it asymmetrically and share copies to journalist around the world. When the time comes, I drop the public key and the cat's out. BUT! Opposition to the dissemination is the most technically powerful actor in the world whose strategy is to edit file to prove it an unreliable forgery and to do that - edited version needs to have the same hash. And they have an edge to do it - the file does contain amount of redundant data that may be changed without affecting underlaying functionality.

Let set a scene. Imaging that I have a 4K video file of a president of a powerful country murdering former secretary of state. The face of the president is seen in only few seconds of a few minutes of video, but would prove damning nonetheless. Its secret spying agency ASN is set to edit the video by planting my face on the murderor's body thus turning tables. Let say that the rehashing effort is of order of billion dollars worth of hashing power of entire bitcoin mining community. If a doctored version with correct hash is produced, my proof would not qualify as beyond the reasonable doubt and the pres walks away.

Ok, I am playing here, but I hope you get my question. How to cryptographically protect integrity of a file that has some redundancy whose fiddling may cover for functional changes? Or, in another words, is there a modern hash functions powerful enough to protect integrity even against available nonce to make editing unfeasible today?

  • And if the answer depends of details, such as file size or avaiable redundant size, rehashing capabilities that would still be valuable information to me. – whoami Nov 19 '17 at 13:48

You are asking for resistance against a pre-image attack, i.e. that an attacker will be able to generate some input data which result in a specific hash value (i.e. the same hash value as the original file). Modern hash functions like the SHA-2 class (i.e. SHA-256, SHA-512...) are considered strong enough against this types of attack while older hashes like MD5 or SHA-1 are considered too weak.

But I'm not sure that it is even needed to generate data with the same hash value to mount an attack. Your scenario is build on the assumption that timestamping the hash (and thus the data) is a strong trust anchor. But, attackers can simply claim that the video is fake in the first place. They might even create some fake videos by their own to show how easy such faking is and thus undermine the trust in your video.

  • Yeah, I picked a bad example on the video stuff, if they had such capability video as such would be discarded as reliable proof for anything. But tnx for replying although I absentmindedly posted to wrong SE - this was suppose to go on crypto. – whoami Nov 19 '17 at 18:24
  • 2
    @whoami: If you are only interested in hash algorithms which are considered safe against pre-image attacks and not about the general problem with your approach then read the first part of my answer. – Steffen Ullrich Nov 19 '17 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.