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.
Experimental project
This is a sandbox project, which contains experimental code for developer use only.
This module is meant to easily allow a Drupal developer to configure per-entity message authentication codes.
Once configured a new property will be available on entities (and in Views) that contains the HMAC.
Note: Currently only supports node entities.
Configuration
- Install and enable the module
- Navigate to the content type configuration form for the desired content types
- Enable the HMAC checkbox under the "Field HMAC" tab
- Select a field or property
- Enter a secret key
Example usage
// Assumes HMAC has been configured.
$wrapper = entity_metadata_wrapper('node', 123);
$hmac = $wrapper->hmac->value();
// Do something/validate with HMAC.
dpm($hmac);
See other
https://en.wikipedia.org/wiki/Hash-based_message_authentication_code
Project information
- Module categories: Security
- Created by steven.wichers on , updated