PHP Code:
<?php
$source = 'Secret password.';
$key = 'Private encryption key';
$td = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_CBC, '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_DEV_RANDOM);
mcrypt_generic_init($td, $key, $iv);
//Encrypt the data, returns as encrypted binary data
$encrypted_source = mcrypt_generic($td, $source);
//Decrypt the data, parse in binary encrypted data, returns plain text string
$decrypted_source = mdecrypt_generic($td, $encrypted_source);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
?>
base64 | MD5 | SHA1 | SHA256 | AES 256 | Blowfish | 3DES