We are all used to using MD5() for generating hashes when saving passwords using php and mysql. But I read some where that method is not that secure. So here is an alternative.
To encode the password before saving use,
to decode the password after retrieving use,