Is it possible to programmatically generate different hash functions? Of course, it is. We can simply tweak the numerical parameters of the hash function. But is there a known way to generate secure hash functions programmatically? I got an idea for a new authentication system, but it relies on using a hash function that MUST be unknown to the attacker. I want the attacker to not be able to try every KNOWN hash function on the planet Earth and break the security.
The idea is the following. I want to be sure someone that someone is who they claim to be. All I know is their initial “name” and a hash function. The name can be any string of fixed length. They hash the name with the hash function and send it to me. I can verify they are who they claim to be. How? I hash the initial name and check whether the result is the same as their hash. The next time we connect the same procedure is repeated only this time we use the new hash as the source. Obviously, there is a problem if we use a common hash function such as SHA 256 as the attacker can easily try different functions on the name until he gets the same hash. That's why I need to be able to generate a unique hash function that the attacker cannot easily guess.