You are here

function field_encrypt_encrypt in Field Encryption 7

Encrypt raw message.

Parameters

string $raw: The raw message to be encrypted.

Return value

string The encrypted data.

3 calls to field_encrypt_encrypt()
FieldEncyptCacheTrait::encrypt in ./field_encrypt.cache.inc
Encrypts the data for the Cache backend.
field_encrypt_do_encrypt in ./field_encrypt.inc
Add encryption to a field.
_field_encrypt_field_storage_pre_update in ./field_encrypt.inc
Implements hook_field_storage_pre_update().

File

./field_encrypt.inc, line 300
Encryption functionality for the Field encrypt module.

Code

function field_encrypt_encrypt($raw) {
  try {
    $encrypted = encrypt($raw, array(
      'base64' => TRUE,
    ));
  } catch (Exception $e) {
    return null;
  }
  return utf8_encode($encrypted);
}