diff --git a/field_encrypt.admin.inc b/field_encrypt.admin.inc
index 0705d75..1d1f121 100644
--- a/field_encrypt.admin.inc
+++ b/field_encrypt.admin.inc
@@ -11,7 +11,6 @@
  */
 function _field_encrypt_field_settings_form_alter(&$form, &$form_state, $form_id) {
 
-
   // Obtain the field name from form (should really be $form_state,
   // but the Date field doesn't comply).
   $field_name = $form['#field']['field_name'];
@@ -27,19 +26,11 @@ function _field_encrypt_field_settings_form_alter(&$form, &$form_state, $form_id
 
   $fld_settings =& $field_info['settings'];
 
-  $can_change = variable_get('FIELD_ENCRYPT_CHANGEABLE', TRUE);
-  if(!$can_change) {
-    if(!empty($fld_settings['field_encrypt']['phrase'])) {
-      drupal_set_message('This field is encrypted but the encyrption information cannot be edited. See site admin to change these settings.');
-    }
-   return;
-  }
   $form_state['field_encrypt'] = array(
     'field_name' => $field_name,
     'field_info' => $field_info,
     'field_type_info' => $field_type_info,
     'encrypt' => isset($fld_settings['field_encrypt']) ? $fld_settings['field_encrypt']['encrypt'] : FALSE,
-    'phrase' => isset($fld_settings['field_encrypt']) ? $fld_settings['field_encrypt']['phrase'] : ''
   );
 
   $settings =& $form['field']['settings'];
@@ -48,28 +39,13 @@ function _field_encrypt_field_settings_form_alter(&$form, &$form_state, $form_id
     '#type' => 'fieldset',
     '#title' => t('Encrypt this field'),
     '#description' => t('Set up the parameters for encrypting this text field.'),
-    '#element_validate' => array('_field_encrypt_field_settings_validate'),
     '#tree' => TRUE,
-
     'encrypt' => array(
       '#type' => 'checkbox',
       '#title' => t('Encrypt this field'),
       '#default_value' => $form_state['field_encrypt']['encrypt'],
       '#weight' => 0,
-  ),
-
-    'phrase' => array(
-      '#type' => 'textfield',
-      '#title' => t('Encryption phrase'),
-      '#description' => t('Field-specific phrase to use during the encoding process for this field.'),
-      '#default_value' => $form_state['field_encrypt']['phrase'],
-      '#weight' => 1,
-      '#states' => array(
-        'visible' => array(
-          'input[name="field[settings][field_encrypt][encrypt]"]' => array('checked' => TRUE),
-  ),
-  ),
-  ),
+    ),
     '#weight' => -2,
   );
 
@@ -77,10 +53,8 @@ function _field_encrypt_field_settings_form_alter(&$form, &$form_state, $form_id
   // but ensure the values carried through
   if (!user_access(FIELD_ENCRYPT_PERMISSION)) {
     $field_encrypt =& $settings['field_encrypt'];
-    foreach (array('encrypt', 'phrase') as $field_index) {
-      $field_encrypt[$field_index]['#type'] = 'value';
-      $field_encrypt[$field_index]['#value'] = $field_encrypt[$field_index]['#default_value'];
-    }
+    $field_encrypt['encrypt']['#type'] = 'value';
+    $field_encrypt['encrypt']['#value'] = $field_encrypt['encrypt']['#default_value'];
   }
 
   // Make sure this file is loaded with this form
@@ -91,47 +65,23 @@ function _field_encrypt_field_settings_form_alter(&$form, &$form_state, $form_id
   $form['#submit'][] = '_field_encrypt_field_settings_submit';
 }
 
-function _field_encrypt_field_settings_validate($element, &$form_state) {
-  if ($element['encrypt']['#value'] && !$element['phrase']['#value']) {
-    form_error($element['phrase'], t('You must provide an encryption phrase if you want to encrypt this field.'));
-  }
-}
-
 function _field_encrypt_field_settings_submit($form, &$form_state) {
   $field_info = $form_state['field_encrypt']['field_info'];
   $old_encrypt = $form_state['field_encrypt']['encrypt'];
-  $old_phrase = $form_state['field_encrypt']['phrase'];
 
   $values =& $form_state['values']['field']['settings']['field_encrypt'];
   $new_encrypt = $values['encrypt'];
-  $new_phrase = $values['phrase'];
 
   if ($old_encrypt) {
-    if ($new_encrypt) {
-      // encryption flag still set, has the phrase changed?
-      if ($new_phrase == $old_phrase) {
-        // phrase is the same too, do nothing
-      }
-      else {
-        // phrase has changed so need to re-encrypt the field
-        module_load_include('inc', 'field_encrypt');
-        field_encrypt_re_encrypt($field_info, $new_phrase);
-      }
-    }
-    else {
+    if (!$new_encrypt) {
       // was encrypted but now unencrypted, so unencrypt it
       module_load_include('inc', 'field_encrypt');
-      field_encrypt_un_encrypt($field_info, $old_phrase);
+      field_encrypt_un_encrypt($field_info);
     }
   }
-  else {
-    if ($new_encrypt) {
-      // encryption flag wasn't set, but is now
-      module_load_include('inc', 'field_encrypt');
-      field_encrypt_do_encrypt($field_info, $new_phrase);
-    }
-    else {
-      // encryption wasn't set, and still isn't, do nothing.
-    }
+  elseif ($new_encrypt) {
+    // encryption flag wasn't set, but is now
+    module_load_include('inc', 'field_encrypt');
+    field_encrypt_do_encrypt($field_info);
   }
-}
\ No newline at end of file
+}
diff --git a/field_encrypt.cache.inc b/field_encrypt.cache.inc
index 7d0c72e..9d1e79e 100644
--- a/field_encrypt.cache.inc
+++ b/field_encrypt.cache.inc
@@ -1,83 +1,81 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Field encrypt - Extension of the Field API to allow encryption of fields - class
- *
- * Modify the set & get methods to encrypt/decrypt the cache, use internal key
- */
-
-class FieldEncryptDatabaseCache extends DrupalDatabaseCache {
-  const KEY = 'May the Force be with you';
-
-  /**
-   * Prepare a cached item.
-   *
-   * Checks that items are either permanent or did not expire, and unserializes
-   * data as appropriate.
-   *
-   * @param $cache
-   *   An item loaded from cache_get() or cache_get_multiple().
-   * @return
-   *   The item with data unserialized as appropriate or FALSE if there is no
-   *   valid item to load.
-   */
-  protected function prepareItem($cache) {
-    global $user;
-    if (!isset($cache->data)) {
-      return FALSE;
-    }
-    // If enforcing a minimum cache lifetime, validate that the data is
-    // currently valid for this user before we return it by making sure the cache
-    // entry was created before the timestamp in the current session's cache
-    // timer. The cache variable is loaded into the $user object by _drupal_session_read()
-    // in session.inc. If the data is permanent or we're not enforcing a minimum
-    // cache lifetime always return the cached data.
-    if ($cache->expire != CACHE_PERMANENT && variable_get('cache_lifetime', 0) && $user->cache > $cache->created) {
-      // This cache data is too old and thus not valid for us, ignore it.
-      return FALSE;
-    }
-
-    // Decrypt the data just before we return it
-    module_load_include('inc', 'field_encrypt');
-    $cache->data = field_encrypt_decrypt($cache->data, self::KEY);
-
-    if ($cache->serialized) {
-      $cache->data = unserialize($cache->data);
-    }
-
-    return $cache;
-  }
-
-  function set($cid, $data, $expire = CACHE_PERMANENT) {
-    $fields = array(
-      'serialized' => 0,
-      'created' => REQUEST_TIME,
-      'expire' => $expire,
-    );
-    if (!is_string($data)) {
-      $fields['data'] = serialize($data);
-      $fields['serialized'] = 1;
-    }
-    else {
-      $fields['data'] = $data;
-      $fields['serialized'] = 0;
-    }
-
-    // encrypt the data just before it's saved
-    module_load_include('inc', 'field_encrypt');
-    $fields['data'] = field_encrypt_encrypt($fields['data'], self::KEY);
-
-    try {
-      db_merge($this->bin)
-        ->key(array('cid' => $cid))
-        ->fields($fields)
-        ->execute();
-    }
-    catch (Exception $e) {
-      // The database may not be available, so we'll ignore cache_set requests.
-    }
-  }
-
-}
+<?php
+// $Id$
+
+/**
+ * @file
+ * Field encrypt - Extension of the Field API to allow encryption of fields - class
+ *
+ * Modify the set & get methods to encrypt/decrypt the cache, use internal key
+ */
+
+class FieldEncryptDatabaseCache extends DrupalDatabaseCache {
+  /**
+   * Prepare a cached item.
+   *
+   * Checks that items are either permanent or did not expire, and unserializes
+   * data as appropriate.
+   *
+   * @param $cache
+   *   An item loaded from cache_get() or cache_get_multiple().
+   * @return
+   *   The item with data unserialized as appropriate or FALSE if there is no
+   *   valid item to load.
+   */
+  protected function prepareItem($cache) {
+    global $user;
+    if (!isset($cache->data)) {
+      return FALSE;
+    }
+    // If enforcing a minimum cache lifetime, validate that the data is
+    // currently valid for this user before we return it by making sure the cache
+    // entry was created before the timestamp in the current session's cache
+    // timer. The cache variable is loaded into the $user object by _drupal_session_read()
+    // in session.inc. If the data is permanent or we're not enforcing a minimum
+    // cache lifetime always return the cached data.
+    if ($cache->expire != CACHE_PERMANENT && variable_get('cache_lifetime', 0) && $user->cache > $cache->created) {
+      // This cache data is too old and thus not valid for us, ignore it.
+      return FALSE;
+    }
+
+    // Decrypt the data just before we return it
+    module_load_include('inc', 'field_encrypt');
+    $cache->data = field_encrypt_decrypt($cache->data);
+
+    if ($cache->serialized) {
+      $cache->data = unserialize($cache->data);
+    }
+
+    return $cache;
+  }
+
+  function set($cid, $data, $expire = CACHE_PERMANENT) {
+    $fields = array(
+      'serialized' => 0,
+      'created' => REQUEST_TIME,
+      'expire' => $expire,
+    );
+    if (!is_string($data)) {
+      $fields['data'] = serialize($data);
+      $fields['serialized'] = 1;
+    }
+    else {
+      $fields['data'] = $data;
+      $fields['serialized'] = 0;
+    }
+
+    // encrypt the data just before it's saved
+    module_load_include('inc', 'field_encrypt');
+    $fields['data'] = field_encrypt_encrypt($fields['data']);
+
+    try {
+      db_merge($this->bin)
+        ->key(array('cid' => $cid))
+        ->fields($fields)
+        ->execute();
+    }
+    catch (Exception $e) {
+      // The database may not be available, so we'll ignore cache_set requests.
+    }
+  }
+
+}
diff --git a/field_encrypt.inc b/field_encrypt.inc
index 29fc9b7..4948b3f 100644
--- a/field_encrypt.inc
+++ b/field_encrypt.inc
@@ -1,307 +1,293 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Encryption functionality for the Field encrypt module.
- */
-
-function field_encrypt_do_encrypt($field_info, $phrase) {
-  $fields = array('field_name', 'entity_type', 'bundle', 'deleted', 'entity_id', 'revision_id', 'language', 'delta', 'value');
-  $loop_fields = array('entity_type', 'bundle', 'deleted', 'entity_id', 'revision_id', 'language', 'delta');
-
-  $inserts = array();
-
-  $field_name = $field_info['field_name'];
-  $table = 'field_data_' . $field_name;
-
-  // Get all the current entries
-  $results = db_select($table, 't')->fields('t')->execute();
-
-  // For each result build the insert data for field_encrypt
-  foreach ($results as $result) {
-    $insert = array(
-      'field_name' => $field_name,
-    );
-    foreach ($loop_fields as $field) {
-      $insert[$field] = $result->$field;
-      unset($result->$field);
-    }
-    if (isset($field_info['settings']['field_encrypt'])) {
-      $insert['value'] = field_encrypt_encrypt(serialize($result), $field_info['settings']['field_encrypt']['phrase']); // encrypt here
-    }
-    $inserts[] = $insert;
-  }
-
-  // Do we have anything to insert?
-  if (!empty($inserts)) {
-    // Build the multiple insert query and do it.
-    $query = db_insert('field_encrypt')->fields($fields);
-    foreach ($inserts as $insert) {
-      $query->values($insert);
-    }
-    $query->execute();
-
-    // remove the rows from the original table
-    db_delete($table)->execute();
-  }
-  drupal_set_message(t('%field_name is now being encrypted', array('%field_name' => $field_name)));
-}
-
-//-------------------------------------------------------
-
-function field_encrypt_un_encrypt($field_info, $phrase) {
-  $base_fields = array('entity_type', 'bundle', 'deleted', 'entity_id', 'revision_id', 'language', 'delta');
-
-  $inserts = array();
-
-  $field_name = $field_info['field_name'];
-  $results = db_select('field_encrypt', 'fe')
-  ->fields('fe')
-  ->condition('fe.field_name', $field_name)
-  ->execute();
-
-  $index = strlen($field_name) + 1;
-  foreach ($results as $result) {
-    $fields = $base_fields;
-    $insert = array();
-    foreach ($fields as $field) {
-      $insert[$field] = $result->$field;
-    }
-
-    $value = field_encrypt_decrypt($result->value, $field_info['settings']['field_encrypt']['phrase']);
-    foreach ((array) unserialize($value) as $key => $val) {
-      $insert[$key] = $val;
-      $fields[] = $key;
-    }
-    $inserts[] = $insert;
-  }
-
-  if (!empty($inserts)) {
-    // Build the multiple insert query and do it.
-    $query = db_insert("field_data_$field_name")->fields($fields);
-    foreach ($inserts as $insert) {
-      $query->values($insert);
-    }
-    $query->execute();
-
-    // remove the rows from the original table
-    db_delete('field_encrypt')->condition('field_name', $field_name)->execute();
-  }
-  drupal_set_message(t('%field_name is no longer being encrypted', array('%field_name' => $field_name)));
-}
-
-//-------------------------------------------------------
-
-function field_encrypt_re_encrypt($field_info, $new_phrase) {
-  $fields = array('field_name', 'entity_type', 'entity_id', 'revision_id', 'language', 'delta');
-
-  // Fetch all the relevant rows
-  $field_name = $field_info['field_name'];
-  $results = db_select('field_encrypt', 'fe')
-  ->fields('fe')
-  ->condition('fe.field_name', $field_name)
-  ->execute();
-
-  $updates = array();
-  foreach ($results as $result) {
-    $update = array();
-    foreach ($fields as $field) {
-      $update[$field] = $result->$field;
-    }
-    $value = field_encrypt_decrypt($result->value, $field_info['settings']['field_encrypt']['phrase']);
-    $update['value'] =  field_encrypt_encrypt($value, $new_phrase);
-
-    $updates[] = $update;
-  }
-
-  // For each update, update it.
-  foreach ($updates as $update) {
-    $value = $update['value'];
-    unset($update['value']);
-
-    $query = db_update('field_encrypt')
-    ->fields(array('value' => $value));
-    foreach ($update as $key => $val) {
-      $query->condition($key, $val);
-    }
-    $query->execute();
-  }
-  drupal_set_message(t('Encryption phrase changed for %field_name.', array('%field_name' => $field_name)));
-}
-
-//-------------------------------------------------------
-
-/**
- * Implements hook_field_storage_pre_insert().
- */
-function _field_encrypt_field_storage_pre_insert($entity_type, $entity, &$skip_fields) {
-  _field_encrypt_field_storage_pre_update($entity_type, $entity, $skip_fields);
-}
-
-/**
- * Implements hook_field_storage_pre_update().
- */
-function _field_encrypt_field_storage_pre_update($entity_type, $entity, &$skip_fields) {
-  static $field_info = NULL;
-  if ($field_info===NULL) {
-    $field_info = field_info_field_by_ids();
-  }
-
-  list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
-  if (is_null($vid)) {
-    $vid = $id;
-  }
-  $default_options = array(
-    'default' => FALSE,
-    'deleted' => FALSE,
-    'language' => NULL,
-  );
-  $instances = _field_invoke_get_instances($entity_type, $bundle, $default_options);
-
-  $merge_base = array(
-    'entity_type' => $entity_type,
-    'entity_id' => $id,
-    'revision_id' => $vid,
-  );
-
-  foreach ($instances as $instance) {
-    // Get the field data
-    $field_id = $instance['field_id'];
-    $field = $field_info[$field_id];
-
-    // Are we encrypting this field?
-    if (!isset($field['settings']['field_encrypt']['encrypt'])) {
-      // encryption setting does not exist, skip it
-      continue;
-    }
-    if (!$field['settings']['field_encrypt']['encrypt']) {
-      // encryption setting is set to FALSE, skip it
-      continue;
-    }
-    $field_name = $instance['field_name'];
-
-    // We're bypassing usual storage, mark field for skipping
-    $skip_fields[$field_id] = $field;
-
-    // If there's nothing in the field, go no further
-    if (empty($entity->$field_name)) {
-      continue;
-    }
-
-    $merge_keys = array_merge($merge_base, array('field_name' => $field_name));
-
-    // Now we need to insert the data, we can't do multiple
-    // merges so we have to do each language/delta separately.
-    foreach ($entity->$field_name as $language => $items) {
-      $merge_keys['language'] = $language;
-      foreach ($items as $delta => $item) {
-        $merge_keys['delta'] = $delta;
-        $value = array();
-        foreach ($item as $key => $val) {
-          $value["{$field_name}_$key"] = $val;
-        }
-        db_merge('field_encrypt')
-        ->key($merge_keys)
-        ->fields(array('value' => field_encrypt_encrypt(serialize($value), $field['settings']['field_encrypt']['phrase']))) // encrypt here
-        ->execute();
-      }
-    }
-  }
-}
-
-/**
- * Implements hook_field_storage_pre_load().
- */
-function _field_encrypt_field_storage_pre_load($entity_type, $queried_entities, $age, &$skip_fields, $options) {
-  static $field_info = NULL;
-  if ($field_info===NULL) {
-    $field_info = field_info_field_by_ids();
-  }
-
-  foreach ($queried_entities as $entity) {
-    list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
-    if (is_null($vid)) {
-      $vid = $id;
-    }
-    $default_options = array(
-    'default' => FALSE,
-    'deleted' => FALSE,
-    'language' => NULL,
-    );
-    $instances = _field_invoke_get_instances($entity_type, $bundle, $default_options);
-
-    foreach ($instances as $instance) {
-      // Get the field data
-      $field_id = $instance['field_id'];
-      $field = $field_info[$field_id];
-
-      // Are we encrypting this field?
-      if (!isset($field['settings']['field_encrypt']['encrypt'])) {
-        continue;
-      }
-      if (!$field['settings']['field_encrypt']['encrypt']) {
-        continue;
-      }
-      $field_name = $instance['field_name'];
-
-      // We're bypassing usual storage, mark field for skipping
-      $skip_fields[$field_id] = $field;
-
-      // Now we need to fetch the encrypted data
-      $results = db_select('field_encrypt', 'fe', array('fetch' => PDO::FETCH_ASSOC))
-      ->fields('fe', array('language', 'delta', 'value'))
-      ->condition('fe.field_name', $field_name)
-      ->condition('fe.entity_type', $entity_type)
-      ->condition('fe.entity_id', $id)
-      ->condition('fe.revision_id', $vid)
-      ->orderBy('fe.language', 'ASC')
-      ->orderBy('fe.delta', 'ASC')
-      ->execute();
-      $field_data = array();
-      $index = strlen($field_name) + 1;
-      foreach ($results as $result) {
-        extract($result); // decrypt here
-        $value = field_encrypt_decrypt($value, $field['settings']['field_encrypt']['phrase']);
-
-        $item = array();
-        foreach ((array) unserialize($value) as $key => $val) {
-          $item[substr($key, $index)] = $val;
-        }
-        $field_data[$language][$delta] = $item;
-      }
-      $entity->$field_name = $field_data;
-    }
-  }
-}
-
-/**
- * Encrypt raw message
- */
-function field_encrypt_encrypt($raw, $key) {
-  $salt_hash = _field_encrypt_salt_hash($key);
-  $encrypted = mcrypt_encrypt(MCRYPT_3DES, $salt_hash, $raw, 'ecb');
-  return base64_encode($encrypted);
-}
-
-/**
- * Decrypt encrypted message
- */
-function field_encrypt_decrypt($encrypted64, $key) {
-  $salt_hash = _field_encrypt_salt_hash($key);
-  $encrypted = base64_decode($encrypted64);
-  $decrypted = mcrypt_decrypt(MCRYPT_3DES, $salt_hash, $encrypted, 'ecb');
-  return rtrim($decrypted, "\0");
-}
-
-/**
- * Make salted and hashed key.
- */
-function _field_encrypt_salt_hash($key) {
-  static $hashes = array();
-  if (!isset($hashes[$key])) {
-    $length = strlen($key)<=24 ? strlen($key) : 24;
-    $hashes[$key] = substr(hash('sha512', $key . drupal_get_hash_salt()), 0, $length);
-  }
-  return $hashes[$key];
-}
+<?php
+// $Id$
+
+/**
+ * @file
+ * Encryption functionality for the Field encrypt module.
+ */
+
+function field_encrypt_do_encrypt($field_info) {
+  $fields = array('field_name', 'entity_type', 'bundle', 'deleted', 'entity_id', 'revision_id', 'language', 'delta', 'value');
+  $loop_fields = array('entity_type', 'bundle', 'deleted', 'entity_id', 'revision_id', 'language', 'delta');
+
+  $inserts = array();
+
+  $field_name = $field_info['field_name'];
+  $table = 'field_data_' . $field_name;
+
+  // Get all the current entries
+  $results = db_select($table, 't')->fields('t')->execute();
+
+  // For each result build the insert data for field_encrypt
+  foreach ($results as $result) {
+    $insert = array(
+      'field_name' => $field_name,
+    );
+    foreach ($loop_fields as $field) {
+      $insert[$field] = $result->$field;
+      unset($result->$field);
+    }
+    if (isset($field_info['settings']['field_encrypt'])) {
+      $insert['value'] = field_encrypt_encrypt(serialize($result)); // encrypt here
+    }
+    $inserts[] = $insert;
+  }
+
+  // Do we have anything to insert?
+  if (!empty($inserts)) {
+    // Build the multiple insert query and do it.
+    $query = db_insert('field_encrypt')->fields($fields);
+    foreach ($inserts as $insert) {
+      $query->values($insert);
+    }
+    $query->execute();
+
+    // remove the rows from the original table
+    db_delete($table)->execute();
+  }
+  drupal_set_message(t('%field_name is now being encrypted', array('%field_name' => $field_name)));
+}
+
+//-------------------------------------------------------
+
+function field_encrypt_un_encrypt($field_info) {
+  $base_fields = array('entity_type', 'bundle', 'deleted', 'entity_id', 'revision_id', 'language', 'delta');
+
+  $inserts = array();
+
+  $field_name = $field_info['field_name'];
+  $results = db_select('field_encrypt', 'fe')
+  ->fields('fe')
+  ->condition('fe.field_name', $field_name)
+  ->execute();
+
+  $index = strlen($field_name) + 1;
+  foreach ($results as $result) {
+    $fields = $base_fields;
+    $insert = array();
+    foreach ($fields as $field) {
+      $insert[$field] = $result->$field;
+    }
+
+    $value = field_encrypt_decrypt($result->value);
+    foreach ((array) unserialize($value) as $key => $val) {
+      $insert[$key] = $val;
+      $fields[] = $key;
+    }
+    $inserts[] = $insert;
+  }
+
+  if (!empty($inserts)) {
+    // Build the multiple insert query and do it.
+    $query = db_insert("field_data_$field_name")->fields($fields);
+    foreach ($inserts as $insert) {
+      $query->values($insert);
+    }
+    $query->execute();
+
+    // remove the rows from the original table
+    db_delete('field_encrypt')->condition('field_name', $field_name)->execute();
+  }
+  drupal_set_message(t('%field_name is no longer being encrypted', array('%field_name' => $field_name)));
+}
+
+//-------------------------------------------------------
+
+function field_encrypt_re_encrypt($field_info) {
+  $fields = array('field_name', 'entity_type', 'entity_id', 'revision_id', 'language', 'delta');
+
+  // Fetch all the relevant rows
+  $field_name = $field_info['field_name'];
+  $results = db_select('field_encrypt', 'fe')
+  ->fields('fe')
+  ->condition('fe.field_name', $field_name)
+  ->execute();
+
+  $updates = array();
+  foreach ($results as $result) {
+    $update = array();
+    foreach ($fields as $field) {
+      $update[$field] = $result->$field;
+    }
+    $value = field_encrypt_decrypt($result->value);
+    $update['value'] =  field_encrypt_encrypt($value);
+
+    $updates[] = $update;
+  }
+
+  // For each update, update it.
+  foreach ($updates as $update) {
+    $value = $update['value'];
+    unset($update['value']);
+
+    $query = db_update('field_encrypt')
+    ->fields(array('value' => $value));
+    foreach ($update as $key => $val) {
+      $query->condition($key, $val);
+    }
+    $query->execute();
+  }
+  drupal_set_message(t('Encryption phrase changed for %field_name.', array('%field_name' => $field_name)));
+}
+
+//-------------------------------------------------------
+
+/**
+ * Implements hook_field_storage_pre_insert().
+ */
+function _field_encrypt_field_storage_pre_insert($entity_type, $entity, &$skip_fields) {
+  _field_encrypt_field_storage_pre_update($entity_type, $entity, $skip_fields);
+}
+
+/**
+ * Implements hook_field_storage_pre_update().
+ */
+function _field_encrypt_field_storage_pre_update($entity_type, $entity, &$skip_fields) {
+  static $field_info = NULL;
+  if ($field_info===NULL) {
+    $field_info = field_info_field_by_ids();
+  }
+
+  list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
+  if (is_null($vid)) {
+    $vid = $id;
+  }
+  $default_options = array(
+    'default' => FALSE,
+    'deleted' => FALSE,
+    'language' => NULL,
+  );
+  $instances = _field_invoke_get_instances($entity_type, $bundle, $default_options);
+
+  $merge_base = array(
+    'entity_type' => $entity_type,
+    'entity_id' => $id,
+    'revision_id' => $vid,
+  );
+
+  foreach ($instances as $instance) {
+    // Get the field data
+    $field_id = $instance['field_id'];
+    $field = $field_info[$field_id];
+
+    // Are we encrypting this field?
+    if (!isset($field['settings']['field_encrypt']['encrypt'])) {
+      // encryption setting does not exist, skip it
+      continue;
+    }
+    if (!$field['settings']['field_encrypt']['encrypt']) {
+      // encryption setting is set to FALSE, skip it
+      continue;
+    }
+    $field_name = $instance['field_name'];
+
+    // We're bypassing usual storage, mark field for skipping
+    $skip_fields[$field_id] = $field;
+
+    // If there's nothing in the field, go no further
+    if (empty($entity->$field_name)) {
+      continue;
+    }
+
+    $merge_keys = array_merge($merge_base, array('field_name' => $field_name));
+
+    // Now we need to insert the data, we can't do multiple
+    // merges so we have to do each language/delta separately.
+    foreach ($entity->$field_name as $language => $items) {
+      $merge_keys['language'] = $language;
+      foreach ($items as $delta => $item) {
+        $merge_keys['delta'] = $delta;
+        $value = array();
+        foreach ($item as $key => $val) {
+          $value["{$field_name}_$key"] = $val;
+        }
+        db_merge('field_encrypt')
+        ->key($merge_keys)
+        ->fields(array('value' => field_encrypt_encrypt(serialize($value)))) // encrypt here
+        ->execute();
+      }
+    }
+  }
+}
+
+/**
+ * Implements hook_field_storage_pre_load().
+ */
+function _field_encrypt_field_storage_pre_load($entity_type, $queried_entities, $age, &$skip_fields, $options) {
+  static $field_info = NULL;
+  if ($field_info===NULL) {
+    $field_info = field_info_field_by_ids();
+  }
+
+  foreach ($queried_entities as $entity) {
+    list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
+    if (is_null($vid)) {
+      $vid = $id;
+    }
+    $default_options = array(
+    'default' => FALSE,
+    'deleted' => FALSE,
+    'language' => NULL,
+    );
+    $instances = _field_invoke_get_instances($entity_type, $bundle, $default_options);
+
+    foreach ($instances as $instance) {
+      // Get the field data
+      $field_id = $instance['field_id'];
+      $field = $field_info[$field_id];
+
+      // Are we encrypting this field?
+      if (!isset($field['settings']['field_encrypt']['encrypt'])) {
+        continue;
+      }
+      if (!$field['settings']['field_encrypt']['encrypt']) {
+        continue;
+      }
+      $field_name = $instance['field_name'];
+
+      // We're bypassing usual storage, mark field for skipping
+      $skip_fields[$field_id] = $field;
+
+      // Now we need to fetch the encrypted data
+      $results = db_select('field_encrypt', 'fe', array('fetch' => PDO::FETCH_ASSOC))
+      ->fields('fe', array('language', 'delta', 'value'))
+      ->condition('fe.field_name', $field_name)
+      ->condition('fe.entity_type', $entity_type)
+      ->condition('fe.entity_id', $id)
+      ->condition('fe.revision_id', $vid)
+      ->orderBy('fe.language', 'ASC')
+      ->orderBy('fe.delta', 'ASC')
+      ->execute();
+      $field_data = array();
+      $index = strlen($field_name) + 1;
+      foreach ($results as $result) {
+        extract($result); // decrypt here
+        $value = field_encrypt_decrypt($value);
+
+        $item = array();
+        foreach ((array) unserialize($value) as $key => $val) {
+          $item[substr($key, $index)] = $val;
+        }
+        $field_data[$language][$delta] = $item;
+      }
+      $entity->$field_name = $field_data;
+    }
+  }
+}
+
+/**
+ * Encrypt raw message
+ */
+function field_encrypt_encrypt($raw) {
+  $encrypted = encrypt($raw, array('base64' => TRUE));
+  return utf8_encode($encrypted);
+}
+
+/**
+ * Decrypt encrypted message
+ */
+function field_encrypt_decrypt($encrypted) {
+  $encrypted = utf8_decode($encrypted);
+  $decrypted = decrypt($encrypted, array('base64' => TRUE));
+  return $decrypted;
+}
diff --git a/field_encrypt.info b/field_encrypt.info
index b362c13..53395ca 100644
--- a/field_encrypt.info
+++ b/field_encrypt.info
@@ -8,4 +8,5 @@ core = 7.x
 files[] = field_encrypt.cache.inc
 
 dependencies[] = field
-dependencies[] = field_ui
\ No newline at end of file
+dependencies[] = field_ui
+dependencies[] = encrypt
