Could I recover the content of file from its checksum/hash?
A simple answer, NO.
It is like asking, if I know, that x%4 = 3
, is it possible to find the value of x
? No. Surely, there would be infinite values of x
satisfying this equation, but you wouldn't simply know which one is correct.
Similarly, many(or infinite) video clips could result in a given hash value(obviously, infinite video clips have to be mapped to a specific number of hash values, so collisions are bound to happen). You wouldn't know which clip is correct.
That too, in human time? No.
EDIT: As pointed out in comments, since the file is chunked into pieces of 2 MB, there won't be infinite possibilities, but it would be pretty large(2 raised to power of 16.7 million, approximately). Brute-forcing such a large number of possibilities, in human time, is still close to impossible. But yeah, it's not infinite.
This is not possible no matter how fast your computer is, simply because you cannot recreate the correct information out of practically nothing.
You are actually asking for restoring 2 MB from 32 byte (size of SHA-256) or at most 64 byte (SHA-256 for chunk and for total file). This would be an ratio of 1:65536 or 1:32768. Given that video is already heavily compressed the chance is practically zero that you could restore the original data from this few information. It might be that you could create a 2 MB chunk which results in the specific SHA-256 hashes but chances are very low that this would be that original chunk.
You could not reproduce the file in any reasonable amount of time. The reason is that the only way to 'reverse' a hash is via brute-force, and considering how large the original file was, it would take you that exact amount of bytes to brute force.
Let's say you have a video file that is 100MB large, precisely.
- 1MB = 1,000,000 bytes
- 100MB = 100,000,000 bytes
This means you would need to brute force this original file and verify it's hash, you'd need to try n^r permutations. Assuming the video file uses only 256 characters per byte (ascii), we'd be looking at:
256100,000,000 ≈ 10240,823,997 ≈ ∞
That's essentially infinite -- it would take basically FOREVER to compute this, regardless of CPU resources.
UPDATE: There's also, of course, the issue with hash collisions that I left out here -- with a Sha256 hash, you're likely going to run into pretty much an infinite amount of collisions with a file as large as our example. I neglected to mention this earlier for simplicity's sake.