To clarify, there are asymetric & symetric encryption algorithms, which is a seperate topic from hashes. Hashes are best defined as "one way" (you can hash it, but not unhash it), whereas encryption you can encrypt & decrypt it.
On the other point, correct, Digest::MD5 (or other hashing solutions) are best used here. The timing is amazing, check out a current post
MD5 - what's the alternative that discusses that hashing question.
- jbWare