Hash Function SHA256

Secure Hash Algorithm is a hash function designed by NSA, National Security Agency. A Hash function can have input of any size data and produces output of fixed size. And it is easily and efficiently computable.

For a hash function to be cryptographically secured, it has to be collision free – two different inputs can not produce same output. And it is impossible to invert, means from hash output, one can not find out what the input was.

Since two inputs can not have same hash output, it helps to use hash as a message digest. Message digest protect the integrity of data. To check the integrity of data, you create hash of your file (the file could be of any size) and upload the file on the internet or send it to some one. If you download the same file or get the same file back from the person you sent, and you want to check if there has not been any changes made to the original file, just produce hash of that file and check if it is same as the one you originally created. If the hash is different, the file has been altered. 

Lest understand with an example:

Input data: I love you

Output hash: wzCE/qplrbu+vQyb8pKib/xt6pexcNiOUBq0hlWRqv0=

Input data: I love you.

Output hash: OHlFyitpwEeKaJqzZztXtGdTrmz76WK2tqLjrz0t2HY=

With a dot in the input data in the second case, output hash changed completely but the size remains the same.

Similarly you can generate hash of data or file of any size. Visit the converter site and try some yourself.