Built on Facts: Sunday Function

Take an integer – one of at least several digits – and multiply it by itself twenty times. The result is going to be some really gargantuan number. Take the last 10 digits of that number. That’s the output of our function, which we’ll call h(n).

…

The resistance can use this property of hash functions to make their resistance network more secure. Instead of distributing a list of all the agent’s passwords, the resistance can distribute a list of the hashes of their passwords. Thus if Bob knows that Alice’s hash is 7001140801, Alice can verify her identity by saying that her password is 314159, which has that as its hash. But if a Nazi double agent (let’s call her Eve) has managed to steal the list of hashes, she still can’t impersonate Alice. Eve doesn’t know what password to use to generate that hash. She could try thousands or millions of guesses and hope that eventually she found one with a hash that matches Alice’s hash, but with all the possible hashes that would be a herculean task.