Encrypted Settings Field

Component ID

1133302

Component name

Encrypted Settings Field

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

3769

Component created

Component changed

Component body

This module adds the "encrypted settings" field through Field API, which has the following two features:

  • The field can be encrypted before saving to the database
  • The field can be validated to follow INI format

This module is ideal to save credential settings information, such as a "Credit Card" field to add to users' profile. For example, the following credit card info:

card_number=123456789
card_holder_name="John Wayne"
card_holder_address="123 South St., Ann Arbor, MI"

would be save to the database as:

kjmtcS84UQl0vCAiongqh82M1m6Q8FebA8IW2EGm
Ojl7IwZSx3B3mufKBx0LBq12HND1Q8TIf8lLq6sZ2BOGh5CGGoLdM
rUiyV8gZxTuEACI1WvIbXlJ+yz8o+GmItsbsFBxNgezKdg=

Note that this field is intended to work with plain text. It doesn't go through any input filters. See #1139994: Rename module to Encrypted Field?. In addition, this module is best to encrypt INI-style settings. To encrypt existing field (could be any type), please see http://drupal.org/sandbox/tedbow/1208762.

You need to install the PHP mcrypt library in order to use the encryption feature. Also, you need to add $mcrypt_secret_key="..." in settings.php file. Otherwise, the first 6 characters of $drupal_hash_salt in settings.php would be used as the secret key for encryption purpose.

Note: The encryption method used in this module has limitation on the lenghth of secret key. For higher level of security, please see #1136440: Integration with "AES" or "Encryption" module. For even higher level of security, please enable https: http://drupal.org/https-information

This module is developed by Daniel Zhou from Michiza Computing