For the complete documentation index, see llms.txt. This page is also available as Markdown.

Transparent Data Encryption

Transparent Data Encryption in GridGain: encrypt data at rest per cache, generate a master key, and rotate master and cache keys.

Overview

Transparent data encryption (TDE) allows users to encrypt their data on disk at rest.

When Ignite persistence is turned on, encryption can be enabled per cache/table, in which case the following data will be encrypted:

  • Data on disk

  • WAL records

Other data, such as data stored in memory, will not be encrypted.

If you enable cache/table encryption, the cluster will generate a key (called cache encryption key) and will use this key to encrypt/decrypt the cache's data. The cache encryption key is held in the system internal memory and cannot be accessed by users. When the key needs to be sent to other nodes or saved to disk (when the node goes down), it is encrypted using the user-provided key — the master key.

The master key must be specified via the configuration in every server node. One way to ensure you are using the same key is to copy the JKS file from one node to the other nodes. In an attempt to enable TDE, the node with a different key will not be able to join the cluster.

The GridGain cluster supports a single Encryption SPI implementation that is KeystoreEncryptionSPI, which uses the running JVM's default keystore format. On Java 17 and later, the default keystore format is PKCS12. You can also explicitly set the keystore.type system property by using the -Dkeystore.type. It supports AES/CBC/PKCS5Padding for encrypting WAL records and AES/CBC/NoPadding for encrypting data pages on disk.

Master Key Generation Example

A keystore with a master key can be created using keytool as follows:

Master Key Generation Example
user:~/tmp:[]$ java -version
java version "17.0.12" 2024-07-16 LTS
Java(TM) SE Runtime Environment (build 17.0.12+8-LTS-286)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.12+8-LTS-286, mixed mode, sharing)

user:~/tmp:[]$ keytool -genseckey -alias ignite.master.key -keystore ./ignite_keystore.p12 -storetype PKCS12 -keyalg aes -storepass mypassw0rd -keysize 256 && keytool -storepass mypassw0rd -storetype PKCS12 -keystore ./ignite_keystore.p12 -list

Generated 256-bit AES secret key
Keystore type: PKCS12
Keystore provider: SUN

Your keystore contains 1 entry

ignite.master.key, Mar 21, 2025, SecretKeyEntry,

Configuration

To enable encryption in the cluster, you should determine an Encryption SPI through Ignite configuration and enable encryption at the last one cache that will be encrypted. A configuration example is shown below.

When the master key is configured, you can enable encryption for a cache as follows:

Master Key Rotation

Master key rotation is required at the end of the crypto period (key validity period) or if the master key has been compromised.

Prerequisites:

  • A new master key must be available to EncryptionSPI for each server node.

  • The cluster must be active.

Available Interfaces

The GridGain cluster enables you to rotate the master key via the following interfaces:

  • Command-line utility

To start master key rotation:

To display the cluster's current master key name:

  • JMX

To start master key rotation:

Get the current master key name:

  • Java API

To start master key rotation:

Get the current master key name:

Master Key Change Procedure

Each server node performs the following actions:

  1. A node checks that the cluster is active. Otherwise, the process completes with an error.

  2. It verifies that the master key name and digest are the same as those taken from the prepare phase. Otherwise, the process is canceled.

  3. The creation of encrypted group keys is blocked.

  4. All cache group keys are re-encrypted with the new master key in a temporary data structure. No changes in MetaStore are made.

  5. The node creates a WAL logical record (ChangeMasterKeyRecord ) that consist of:

  • New master key name

  • Re-encrypted cache group keys

  1. The node writes cache group keys to MetaStore.

  2. The creation of encrypted group keys is unblocked.

Cache Key Rotation

Cache encryption key rotation is required if the key is compromised or at the end of the crypto period (key validity period). This feature is also needed to provide support for encrypting and decrypting existing caches in the future.

Note that the old keys will no longer be used to write new data to the storage. Reading can be done using the old key.

The process of cache encryption key rotation consists of the following steps:

  1. Rotate cache group key - add a new encryption key on each node and set it for writing.

  2. Schedule background re-encryption for archived data and clean up the old key when it completes.

You can manage the process of cache key rotation (and cache re-encryption) through the command line by executing the following commands:

  • Launch cache key rotation:

  • View key identifiers of the cache group:

  • View re-encryption status for the cache group:

  • Suspend/resume the cache group re-encryption:

  • View/change the re-encryption rate limit:

Note: Old cache group encryption key will be removed when:

  • The cache group's re-encryption process is finished, and then at least one checkpoint is successfully completed as well.

  • The last WAL segment, in which the encryption key was used, is removed.

This page is: Copyright © 2026 MariaDB. All rights reserved.

spinner

Last updated

Was this helpful?