block_encryption_mode

2025-11-14 07:33:33  Updated

Note

This variable is available starting with V2.1.

Description

block_encryption_mode specifies the encryption algorithm used in the aes_encrypt and aes_decrypt functions.

Privilege requirements

  • Query variables

    • Global level

      sys tenants and all user tenants can execute the SHOW VARIABLES statement or query the SYS.TENANT_VIRTUAL_GLOBAL_VARIABLE view (Oracle mode) or the information_schema.GLOBAL_VARIABLES view (MySQL mode) to view the value of global system variables.

    • Session level

      sys tenants and all user tenants can execute the SHOW VARIABLES statement or query the SYS.TENANT_VIRTUAL_SESSION_VARIABLE view (Oracle mode) or the information_schema.SESSION_VARIABLES view (MySQL mode) to view the value of session system variables.

  • Modify variables

    • Global level

      • sys tenants can directly modify the value of global system variables.

      • MySQL user tenants must have the SUPER or ALTER SYSTEM privilege to modify the value of global system variables.

      • Oracle user tenants must have the ALTER SYSTEM privilege to modify the value of global system variables.

    • Session level

      sys tenants and all user tenants can directly modify the value of session system variables.

Attributes

Attribute Description
Type Enum
Default value aes-128-ecb
Value range
  • aes-128-ecb
  • aes-192-ecb
  • aes-256-ecb
  • aes-128-cbc
  • aes-192-cbc
  • aes-256-cbc
  • aes-128-cfb1
  • aes-192-cfb1
  • aes-256-cfb1
  • aes-128-cfb8
  • aes-192-cfb8
  • aes-256-cfb8
  • aes-128-cfb128
  • aes-192-cfb128
  • aes-256-cfb128
  • aes-128-ofb
  • aes-192-ofb
  • aes-256-ofb
  • sm4-ecb
  • sm4-cbc
  • sm4-cfb
  • sm4-ofb
Scope
  • Global
  • Session
Modifiable Yes. You can execute the SET statement to modify the value.

Examples

Set the encryption algorithm used in the aes_encrypt and aes_decrypt functions to aes-128-ecb.

  • Global level

    obclient> SET GLOBAL block_encryption_mode='aes-128-ecb';
    
  • Session level

    obclient> SET block_encryption_mode='aes-128-ecb';
    

Contact Us