Encryption

Last modified: November 19, 2024

Introduction

The Encryption module takes care of the following encryption needs:

  • Plain text encryption (for example, passwords)
  • FileDocument encryption (for example, files or photos)

Plain Text Encryption

Encrypt and decrypt plain texts using the AES algorithm. The key used for encryption is configured as a constant and remains on the application server.

Typical Use Cases

The typical usage scenario is when an app/module consumes a service where a user name and password are required, you can store the password in an encrypted way in the database.

Limitations

  • Currently only AES is supported

Configuration

EncryptionKey Constant

Set the EncryptionKey constant located in the Private - String en/de-cryption folder. Make sure the key consists of 16 characters.

In version 2.2.0, the key length was increased from 128 to 256 bits. The EncryptionKey constant must now have a key with 32 characters. The LegacyEncryptionKey constant can be used for the 128 bits, in order to decrypt strings that were encrypted using an older version of the Encryption module.

EncryptionPrefix Constant

Set the EncryptionPrefix constant located in the Private - String en/de-cryption folder. The value depends on the module version you are using:

  • For version 2.2.0 or above, set the constant to {AES3}
  • For versions 1.4.1–2.1.3, set the constant to {AES2}

FileDocument Encryption

Encrypt and decrypt the contents of FileDocument entities using the PGP algorithm. The key used for symmetric encryption is embedded into encrypted file content. The certificate to use asymmetric encryption of the symmetric key is stored in the database.

Typical Use Cases

One of the typical usage scenarios may be an app/module that stores customer sensitive documents such as photos. In such a case, you may want to encrypt those documents in a way that only the owner can see.

Configuration

No configuration is needed. However, you should generate or upload certificates upfront using the CertificateManagement page.