Q:

Magento password encrypt in my custom module

I am new to magento.
In my site, I want to create new profile module. 
In my new module have like this fields also

current password 
new password
confirm new password.

By default the password stored encrypt password like this 24d2f566950ed1af94c01d1ec5ce0f48:2e. 
My Question is How to encrypt password like this in magento?

A:

To get a password hash like Magento does it you can use the Encryption model in Core like so:
$password = 'test';
$encrypted = Mage::getSingleton('core/encryption')->getHash($password);

If you'd like to validate the encrypted value with the plain password you can do so using the same model:
Mage::getSingleton('core/encryption')->validateHash($password, $encrypted);

