Closed (outdated)
Project:
Field Encryption
Version:
7.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Mar 2015 at 18:18 UTC
Updated:
12 Mar 2025 at 08:03 UTC
Jump to comment: Most recent
Comments
Comment #1
lizzjoyComment #2
rlhawkAre you using Field Encrypt to manage which fields to encrypt? That module should handle encrypting any existing data for the chosen field.
Comment #3
rlhawkChanged title to be more descriptive. If the problem is related to Field Encrypt, I'll move the issue there, but I'll wait to hear back from the poster.
Comment #4
souvikda commentedI am using Encrypt module
https://www.drupal.org/project/encrypt
with aes encryption.
Comment #5
rlhawkRight, but Encrypt just provides an API. What are you actually using to employ that API? Did you write custom code or are you using a contributed module?
Comment #6
souvikda commentedEncrypt Form API contributed module has been used for encryption.
Comment #7
rlhawkMoved to Encrypt Form API.
Comment #8
rlhawkEncrypt Form API only encrypts when a form is submitted, so it doesn't encrypt existing data. You'll need to handle that yourself.
Comment #9
souvikda commentedwe have used Field Encrypt module but it is not encrypting older data. Is there is some way to write custom script to encrypt the older data ?
Comment #10
rlhawkOK, so you are using Field Encryption. That module should encrypt your existing data automatically when you choose a field to encrypt. If you somehow have unencrypted data, though, you can certainly write a custom script to load each entity and detect if the data for a field is encrypted, and if not, encrypt it and save.
Comment #11
rlhawkComment #12
souvikda commentedcan you help me with some custom scripts to do that.
Comment #13
rlhawksouvikda, did you find a solution? If not, a general outline for the script would be to load all entities in batches, cycling through one at a time looking for an indication of encryption (perhaps through a regular expression); if the field you're processing is not encrypted, call encrypt() with the data and save the entity. I recommend using an entity field wrapper for the getting and setting.
Comment #14
jnicola commentedSo I've run into a similar issue to this, but not via the same path this user took.
Using this module in a standard fashion where you enable it on a field either earl in the process, or at a distinct point on a specific site works without issue. However, sites are more dynamic than this. What if you have a live site collecting unencrypted data and you're working towards deploying encryption.
Features is a standard method for deployment, and when I tested deployment with features, features updated the field in a fashion that never actually triggered field_encrypt_do_encrypt().
Our workaround for this is that I've written a custom batch enable module that batch enables encryption on the modules instead of relying on features to deploy. This in turn triggers field_encrypt_do_encrypt() properly and all fields wind up encrypted.
This doesn't really help define the solution much, but may shed light on some of the problem occurring for some users?
Comment #15
deciphered@jnicola, I've opened a new issue with the comments you've made, as I believe it's probably a separate issue to the originally reported issue: #2703415: Feature deployed fields not triggering encryption.
Comment #16
decipheredOriginal issue from @souvikda will require more information, namely steps to reproduce the issue, before I can attempt to resolve said issue.
Comment #17
ptmkenny commentedDrupal 7 is EOL (end of life) so 7.x issues are now being closed.