This module provides a global encryption service that can be invoked via the services interface.
Encrypt leverages the Drupal 8 Plugin API for Encryption Methods. It also leverages the Key module for maintenance of encryption Keys.
Plugins allow for extensibility for customized needs.
The service is configured through the settings form, found at admin/config/security/encryption
.
It requires a key, which is provided by the Key module. To manage keys, visit admin/config/system/key
.
After configuring the service, the service provides the ability to encrypt and decrypt.
Drupal::service('encryption')->encrypt($string);
Drupal::service('encryption')->decrypt($string);