in reply to MD5 and passwords

I'm not sure I want to digest all of that code to figure out your real question. MD5 is a string hashing algorithm and it handles '&' as part of the strings it hashes just fine. The md5_hex sub offered by Digest::MD5 doesn't appear deficient in this regard at all.

Some databases offer an MD5 function if that's what you need. In MySQL for example, you can place md5( 'foo&bar' ) as a value into an insert, update, select, or delete and the value '44d04b237ba2fdda8b13bc2b119929b6' gets matched against your data. It might be easier to use a feature like that if you're having issues with using MD5 in your Perl code.