Understanding Data Encryption Keys and Master Keys
Encryption works by using a key, which is a piece of data, to scramble plaintext into ciphertext. When you first begin using the application, generates a random key that is never saved in plaintext anywhere. That is the data encryption key, or DEK. All data is encrypted using this key. A master key (also known as a Key Encryption Key or KEK) does not encrypt data directly. Instead, it is a wrapper which encrypts other keys. also provides a built-in master key, but as mentioned above, you can define your own master key instead. The remainder of this topic describes how to create or update your user-defined master key.Define Custom Master Key
The way in which you define a master key varies by edition type.-
Cross-Platform edition: Define the key using the cdata.encryption.key property in the arc.properties configuration file. If you are defining a PFX key and require a password, set it in the cdata.encryption.key.password property. Alternatively, if you are using an AES key, you can use the
APP_KEYenvironment variable to supply the file path to the key file. -
.NET edition: If you do not find an
AppKeysetting inside yourappSettingselement in the Web.Config file, master key encryption is disabled. To enable it, set a file path in theAppKeysetting element in the Web.Config file. If you are defining a PFX key and require a password, set it in theAppKeyPasswordsetting. Here is the XML snippet in Web.Config that you need to add:
Change Master Key
If necessary, you can replace the master key file. always uses the key that you have provided for encryption. Key files are securely managed and backed up, and the process is designed to minimize risk and complexity for users. To change the master key, ensure that you have stopped the server, then use one of the following options:- Cross-Platform edition: Administrators can use the
arc.jar -ChangeMasterKey <new-master-key-file-path>command to rotate the encryption key without disrupting operations. If you are changing the master key to a PFX file, and you require a password, use thearc.jar -ChangeMasterKey <new-master-key-file-path> <new-master-key-password>command. - .NET edition: Administrators must use the
CData.exe appChangeMasterKey -NewKey <new-master-key-file-path> -@libdir "www\bin"command (do not modify the Web.Config file directly). If you are changing the master key to a PFX file, and need a password, use theCData.exe appChangeMasterKey -NewKey <new-master-key-file-path> -NewKeyPassword <new-PFX-password> -@libdir "www\bin"command.
only supports the RSA algorithm in PFX certificate files. Other DSA or ECC certificates are rejected.
Use Safe Mode
If you lose your custom master key and need to re-save your configuration’s sensitive values (from another source of record that you have), you can start in safe mode. This disables all backend automation services and enables very limited features so you can try to recover your settings and other tasks. To enable safe mode:- Cross-Platform edition: Run
java -jar arc.jar -safemode - .NET edition: Add
<add key="SafeMode" value="true" />to theappSettingselement of your Web.Config file.