eli5: Lots of websites will have a file hash you can use to verify file integrity; computationally speaking how is this created? Do you really need to inspect every character or just make sure the first and last few are correct? For well known programs should you verify the hash with a third party?

301 views

eli5: Lots of websites will have a file hash you can use to verify file integrity; computationally speaking how is this created? Do you really need to inspect every character or just make sure the first and last few are correct? For well known programs should you verify the hash with a third party?

In: 3

6 Answers

Anonymous 0 Comments

Not ELI5, but ELI7.

A file is a list of small numbers. Each number Is between 0 and 255. (Aside: we call this a byte.) all images, videos, zip files and so on are like this. A simple hash would be to add all the numbers in the file together, and then see if that sum is odd or even. If you had a file and you weren’t sure if it had been changed, I could tell you the file was meant to be odd, and if your file was even you would know for sure it had been changed.

File hashes are like this, but with a lot of fancy maths, and instead of a single odd/even like choice, they would have 160, or 256 choices. As the number of choices about the file goes up, it is less and less likely to be wrong. For example, if I told you that the last digit was odd, and the second to last digit was even, then there are three ways to notice wrong files, and only one way to miss it being changed.

Does this help?

You are viewing 1 out of 6 answers, click here to view all answers.