Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Field Encryption

3,094 sites Security covered
View on drupal.org

This module provides the ability to encrypt field values stored in the database. It relies on the Encrypt module for its encryption and decryption capabilities, and configuration is managed through the field edit page. Be aware that encrypted fields may not function with certain Views filters, entity queries, or entity query constraints, and some bundle fields are not supported.

Adds options to encrypt field values.

The goal of this module is to create a method for encrypting and decrypting field values when stored in the database.

This module depends on the Encrypt module for encrypting and decrypting strings.

Install this module like any other module. Field encryption settings are made on the field edit page.

Original code created by adaddinsane

Known Issues

Drupal 11.1 and 11.2 require 4.0.x

Drupal 11.1 made several changes to the hooks system, which required us to rewrite this module (the 4.x branch).

Drupal 11.3+ requires 4.1.x

Drupal 11.3 made some more changes to the hooks system, so you will need to update to 4.1+.

No views filter support

Since the field data is encrypted these field values will not work with Views Filters, regular, exposed or contextual. See more discussion in this issue.

No query comparison support

Encrypted fields cannot be queried using APIs that depend on direct database value comparisons, such as entityQuery(), EntityTypeManager::loadByProperties(), and direct database queries.

No entity query constraint support (e.g., UniqueField)

Because of the way this module is implemented, field constraints that rely on an entity query (e.g., UniqueField) will not work (the values of the fields cannot be checked by the entity query). For more information, see this issue: Field Encryption prevents UniqueField from working as intended.

Bundle fields created with ContentEntityBase::bundleFieldDefinitions() are not supported

Bundle fields created via Field UI module can be encrypted, but bundle fields created with ContentEntityBase::bundleFieldDefinitions() are not currently supported.

Incompatible modules

Important

Since this is module deals with encryption of data, which is presumably sensitive data, use the DEV, ALPHA, and BETA versions with extreme caution.

Activity

Total releases
9
First release
Mar 2025
Latest release
1 month ago
Releases (12 mo)
6 ▲ from 3
Maintenance
Active

Release Timeline

Releases

Version Type Release date
4.1.0 Stable Jun 14, 2026
4.1.0-beta1 Pre-release Dec 9, 2025
4.0.0 Stable Dec 9, 2025
4.0.x-dev Dev Dec 9, 2025
4.0.0-beta2 Pre-release Jul 26, 2025
4.0.0-beta1 Pre-release Jul 23, 2025
4.0.0-alpha2 Pre-release May 14, 2025
4.0.0-alpha1 Pre-release Mar 12, 2025
3.2.1 Stable Mar 10, 2025