I'm a complete noob. I was reading up on hash functions. So if a bank has its user password's run through a hash function, it'll produce a unique hash for every password right? Thus, even if hackers are able to get their hands on some data, they'll only have the hashes and not the original passwords.
But I also read that if a hacker runs a lot of common passwords through a hash function, and then compares the common hashes he generated with the stolen hashes, he can find the original passwords out.
My question is, the hacker can do this only if he knows how the hash function (used by the bank) works. He obviously can't generate the hashes of common passwords if he doesn't know how the hash function used by the bank works. So then why is hashing without salts a security hazard? Does this mean that all hash functions work the same?