Back to Shardingsphere

Encrypt.En

docs/document/content/user-manual/common-config/builtin-algorithm/encrypt.en.md

5.5.31.6 KB
Original Source

+++ title = "Encryption Algorithm" weight = 5 +++

Background

Encryption algorithms are by the encryption features of Apache ShardingSphere. A variety of algorithms are built-in to make it easy for users to fully leverage the feature.

Parameters

Standard Encrypt Algorithm

AES Encrypt Algorithm

Type: AES

Attributes:

NameDataTypeDescription
aes-key-valueStringAES KEY
digest-algorithm-nameStringAES KEY DIGEST ALGORITHM

Assisted Encrypt Algorithm

MD5 Assisted Encrypt Algorithm

Type: MD5

Attributes:

NameDataTypeDescription
saltStringSalt value(optional)

Operating Procedure

  1. Configure encryptors in an encryption rule.
  2. Use relevant algorithm types in encryptors.

Configuration Examples

yaml
rules:
- !ENCRYPT
  tables:
    t_user:
      columns:
        username:
          cipher:
            name: username
            encryptorName: name_encryptor
          assistedQuery:
            name: assisted_username
            encryptorName: assisted_encryptor
  encryptors:
    name_encryptor:
      type: AES
      props:
        aes-key-value: 123456abc
        digest-algorithm-name: SHA-1
    assisted_encryptor:
      type: MD5
      props:
        salt: 123456