Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here is an example of using this module for CCK Fields
This is for hook_nodeapi
case 'presave':
//ENCRYPT
if ($node->type == "accounts")
{
$node->field_myfield[0]["value"] = aes_encrypt($node->field_myfield[0]["value"]);
}
case 'load':
//DECRYPT
if ($node->type == "accounts")
{
$node->field_myfield[0]["value"] = aes_decrypt($node->field_myfield[0]["value"]);
}
break;
Comments
Comment #1
giorgio79 CreditAttribution: giorgio79 commentedComment #2
techypaul CreditAttribution: techypaul commentedNot being a php programmer - do I create a custom module and stick this in? do you have a premade custom module for this? right now I only need this on one cck field so I could use your example to make it work for me quite easily I think?
Thanks,
Paul.