Updated on 2026-07-07 GMT+08:00

Scenario 1: Configuring and Operating Encryption Functions

Overview

The data encryption module is a critical security tool that protects data across various application scenarios by converting plaintext data in the database into ciphertext. It also provides the functional and data foundation for subsequent transparent encryption and decryption.

Encryption Operation Flow

This section outlines the steps and workflow of data encryption using a flowchart.

Figure 1 Encryption operation flow

Prerequisite

Before using this system, ensure that the following prerequisites are met to guarantee proper system operation and optimal performance:

  1. Network connection: Ensure your device maintains a stable connection to the local area network. The stability of the network connection is critical for system data synchronization, updates, and online functionality.
  2. Database Access: Ensure the database server port is open and accessible from your network environment. This ensures smooth data access and interaction operations.
  3. Storage space: Check whether your device has sufficient hard drive space to accommodate system installations, temporary files generated during operation, and anticipated data storage requirements.
  4. Permission requirements: Depending on your operating system, ensure you have sufficient permissions to install and run the system. In some environments, administrator permissions may be required to complete the installation process.
  5. Compatibility: Verify that your hardware and software environment is compatible with the system requirements, including the operating system version, necessary dependency libraries, and supported database types.
  6. Security Measures: Before installing and using the system, it is recommended to evaluate existing security measures—including firewall configurations, data encryption, and access controls—to protect your data security.
  7. Backup Strategy: Before using the system, it is recommended to establish and implement a data backup strategy to enable rapid recovery in case of data loss or system failure.

    Ensuring these prerequisites are met will help prevent potential operational issues and ensure a smooth experience when using the system. If you encounter any questions or difficulties during preparation, contact technical support for assistance.

Configure Data Source

  1. Logging In to the Database Encryption System using the system administrator sysadmin account.
  2. In the left navigation tree, choose Database > Add Data Source.

    Figure 2 Creating a new data source

  3. Select data source type

    Figure 3 Select data source type

  4. Fill in the configuration information. For the parameter description of the data source configuration information, refer to the Table 1.

    Figure 4 Enter data source information
    Table 1 Table1 Data source configuration parameter description

    Parameter

    Description

    Data Source Name

    Customizable name (no special characters). Length ≤ 25 characters.

    Connection Type

    Displayed only when Data Source Type is ORACLE.

    Options:

    • Service Name.
    • SID.

    Service Name

    Displayed only when Data Source Type is ORACLE.

    Custom service name.

    Address

    IP address or domain name for database connection (supports IPv4/IPv6).

    Port

    The port for accessing the database, such as MySQL's 3306

    Database Name

    Name of the target database for encryption/masking. Not displayed for ORACLE.

    Username

    Authentication credential for database access.

    Password

    Authentication credential for database access.

    Database Version

    Auto-generated by clicking Detect Version.

    Character Encoding

    Supported encodings:

    • When the data source type is MYSQL, POSTGRESQL, or MSSQLSERVER, the following character encodings are available
      • UTF8
      • GBK
    • When the data source type is ORACLE, the following character encodings are available:
      • AL32UTF8
      • ZHS16GBK
    • When the data source type is DB2, the following character encodings are available:
      • Unicode
      • UCS-2
      • UTF16
      • UTF8

  5. Click Confirm to save the data source asset information.
  6. The created data source is displayed on the Database page, indicating that the data source is successfully created.

Configuring Keys

  1. Logging In to the Database Encryption System using the system administrator sysadmin account.
  2. In the left navigation tree, choose Rule Management > Encryption Rule > Add Encryption.
  3. Fill in the information to create an encryption category. For details about the parameters for adding encryption, refer to the Table 2.

    Figure 5 Create an encryption category
    Table 2 Table2 Encryption algorithm parameter description

    Parameter

    Description

    Secret key name

    This field is mandatory. You can enter a custom name based on your business needs. The name cannot contain special characters and must be no longer than 20 characters.

    Encryption Algorithm

    Select an encryption algorithm from the dropdown menu. Currently supports the SM4_GCM algorithm mode.

  4. Click the icon on the left, select Add Key, enter the key name, and click Confirm.

    Figure 6 Add Key
    Table 3 Table3 Key configuration parameter description

    Parameter

    Description

    Secret Key Name

    Custom string, fill in based on business requirements.

    Encryption Algorithm

    The algorithm pattern for the current key is read-only and cannot be modified.

  5. Save the settings and view the result.

    Figure 7 View key

Configuring Projects

  1. Logging In to the Database Encryption System using the system administrator sysadmin account.
  2. In the left navigation tree, choose Project Management > AddProject.
  3. Follow the wizard to select the database, schema, table, data domain, and other information, then save and exit. For details, refer to the Table 1.
  4. The created project is shown in Figure 8.

    Figure 8 Project created successfully

Performing Encryption

  1. Select the project to be encrypted and click Enter to access the created project.

    Figure 9 Accessing project

  2. In the left navigation tree, select Encryption Settings Management->Encryption Policy Settings, choose the table to be encrypted, switch to the Field Encryption Configuration tab, click Edit, select the field to be encrypted, and click Set to open the Set Encryption Rule dialog box.

    Figure 10 Encryption policy settings

  3. Configure the key and click Confirm Rule. After returning to the page, click Save to save the rules.

    Figure 11 Setting encryption rules

  4. Click Encrypt to perform encryption.

    Figure 12 Performing encryption

  5. After encryption is complete, you can view the actual result.

    Figure 13 View data decryption results

Other Notes

This section provides a brief overview of the functional workflows to give you a clear operational picture. For detailed instructions and specific steps at each stage, refer to the comprehensive explanations in subsequent chapters, where each workflow step is thoroughly explained and analyzed.