A good hash function is surjective. Encryption is bijective. They're very different things.