Logo
Data Encryption

Data Encryption #

Configuration Entry #

Class name: org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration

configurable properties:

NameData typeDescriptionDefault value
tables (+)Collection<EncryptTableRuleConfiguration>Encrypt table rule configuration
encryptors (+)Map<String, ShardingSphereAlgorithmConfiguration>Encryption and decryption algorithm name and configuration
queryWithCipherColumn (?)booleanWhether to use encrypted columns for queries. In the case of the plain text column, you can use the plain text column to querytrue

Encrypt Table Rule Configuration #

Class name: org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration

configurable properties:

NameData typeDescriptionDefault value
nameStringTable name
columns (+)Collection<EncryptColumnRuleConfiguration>Encrypt column rule configuration list
queryWithCipherColumn (?)booleanWhether the table uses encrypt columns for queriestrue

Encrypt column rule configuration #

Class name: org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration

configurable properties:

NameData typeDescription
logicColumnStringLogical column name, required
dataTypeStringLogical column type, Optional (Required if other encrypted column, assist query column or plaintext column types are configured)
cipherColumnStringCipher column name, required
cipherDataTypeStringCipher column type, Optional (Required if logical column type is configured)
assistedQueryColumnStringAssist query column name, Optional
assistedQueryDataTypeStringAssist query column type, Optional (Required if assist query column and logical column types are configured)
plainColumnStringPlain column name, Optional
plainDataTypeStringPlain column type, Optional (Required if plain text column and logical column type are configured)
encryptorNameStringEncrypt algorithm name, required

Encryption And Decryption Algorithm Configuration #

Class name: org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration

configurable properties:

NameData typeDescription
nameStringEncryption and decryption algorithm name
typeStringEncryption and decryption algorithm type
propertiesPropertiesEncryption and decryption algorithm properties configuration

For details of encrypt algorithm types, please refer to Built-in encrypt algorithm list.