Updated on 2022-09-19 GMT+08:00

AES

Encrypt the character string using the AES encryption algorithm.

AES algorithm configurations: The initial vector (IV) is a 16-byte random number. The encryption mode is GCM. PKCS7-Padding (CMS-Padding) is recommended.

In the encryption and data masking result, the first 16 bytes of an encrypted string is the initialization vector (IV) and the rest is the enciphered text. The ciphertext is in binary format. The ciphertext entered into the masking engine is encoded using Base64 and stored in the database as a character string.

Request Parameters

Table 1 Parameter description

Parameter

Mandatory

Type

Description

algorithm

Yes

String

Algorithm type, for example, AES

parameters

Yes

For details, see Table 2.

Parameters for configuring a data masking algorithm

Table 2 Parameters for configuring a data masking algorithm

Parameter

Mandatory

Type

Description

key

Yes

String

AES algorithm key

len

Yes

String

Key group length

Currently, only 128, 192, and 256 are supported.

Example Request

{
"mask_strategies": [
{
"name": "col1",
"algorithm": "AES",
"parameters": {
"key": "df643533b90b6926c9bff63cc16173db",
"len": "128"
}
}
],
"data": [
{
"col1": "test"
}
]
}