You are here

function password_field_decrypt in Password Field 7

Decrypt a password string.

1 call to password_field_decrypt()
password_field_field_formatter_view in ./password_field.module
Implements hook_field_formatter_view().

File

./password_field.module, line 236
Password Field Module

Code

function password_field_decrypt($str) {
  $key = md5(drupal_get_hash_salt());

  // Get the IV and the encrypted data.
  list($encrypted_data, $iv) = explode('::', base64_decode($str), 2);
  return trim(openssl_decrypt($encrypted_data, ENCRYPT_METHOD, $key, 0, $iv));
}