Encryption Algorithm

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 (optional, default: SHA-1)

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

  1. rules:
  2. - !ENCRYPT
  3. tables:
  4. t_user:
  5. columns:
  6. username:
  7. cipher:
  8. name: username
  9. encryptorName: name_encryptor
  10. likeQuery:
  11. name: name_like
  12. encryptorName: like_encryptor
  13. encryptors:
  14. like_encryptor:
  15. type: CHAR_DIGEST_LIKE
  16. name_encryptor:
  17. type: AES
  18. props:
  19. aes-key-value: 123456abc