Generic hashing algorithm for passwords implemented in Perl