Logo
Encryption

Encryption #

Configuration Item Explanation #

spring.shardingsphere.datasource.names= # Omit the data source configuration, please refer to the user manual

spring.shardingsphere.rules.encrypt.tables.<table-name>.query-with-cipher-column= # Whether the table uses cipher columns for query
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.data-type= # Logical column type
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.cipher-column= # Encrypted column name
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.cipher-data-type= # Encrypted column type
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.assisted-query-column= # Query auxiliary column name
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.assisted-query-data-type= # Query auxiliary column type
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.plain-column= # Plaintext column name
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.plain-data-type= # Plaintext column type
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.encryptor-name= # Encryption algorithm name

# Encryption algorithm configuration
spring.shardingsphere.rules.encrypt.encryptors.<encrypt-algorithm-name>.type= # Encryption algorithm type
spring.shardingsphere.rules.encrypt.encryptors.<encrypt-algorithm-name>.props.xxx= # Encryption algorithm attribute configuration

spring.shardingsphere.rules.encrypt.queryWithCipherColumn= # Whether query with cipher column for data encrypt. User you can use plaintext to query if have.

Example #

spring.shardingsphere.rules.encrypt.encryptors.pwd-encryptor.type=AES
spring.shardingsphere.rules.encrypt.encryptors.pwd-encryptor.props.aes-key-value=123456ab

spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.cipher-column=pwd_encrypt
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.data-type=INT NOT NULL
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.cipher-data-type=VARCHAR(200) NOT NULL
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.plain-column=pwd_plain
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.plain-data-type=INT NOT NULL
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.assisted-query-column=pwd_assisted
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.assisted-query-data-type= VARCHAR(200) NOT NULL
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.encryptor-name=pwd-encryptor

Please refer to Built-in Encrypt Algorithm List for more details about type of algorithm.