Encrypt

Syntax

  1. SHOW ENCRYPT RULES [FROM schemaName]
  2. SHOW ENCRYPT TABLE RULE tableName [from schemaName]
  • Support to query all data encryption rules and specify logical table name query

Return Value Description

ColumnDescription
tableLogical table name
logic_columnLogical column name
cipher_columnCiphertext column name
plain_columnPlaintext column name
encryptor_typeEncryption algorithm type
encryptor_propsEncryption algorithm parameter

Example

Show Encrypt Rules

  1. mysql> show encrypt rules from encrypt_db;
  2. +-----------+--------------+---------------+--------------+----------------+-------------------------+
  3. | table | logic_column | cipher_column | plain_column | encryptor_type | encryptor_props |
  4. +-----------+--------------+---------------+--------------+----------------+-------------------------+
  5. | t_encrypt | order_id | order_cipher | NULL | MD5 | |
  6. | t_encrypt | user_id | user_cipher | user_plain | AES | aes-key-value=123456abc |
  7. | t_order | item_id | order_cipher | NULL | MD5 | |
  8. | t_order | order_id | user_cipher | user_plain | AES | aes-key-value=123456abc |
  9. +-----------+--------------+---------------+--------------+----------------+-------------------------+
  10. 4 rows in set (0.01 sec)

Show Encrypt Table Rule Table Name

  1. mysql> show encrypt table rule t_encrypt;
  2. +-----------+--------------+---------------+--------------+----------------+-------------------------+
  3. | table | logic_column | cipher_column | plain_column | encryptor_type | encryptor_props |
  4. +-----------+--------------+---------------+--------------+----------------+-------------------------+
  5. | t_encrypt | order_id | order_cipher | NULL | MD5 | |
  6. | t_encrypt | user_id | user_cipher | user_plain | AES | aes-key-value=123456abc |
  7. +-----------+--------------+---------------+--------------+----------------+-------------------------+
  8. 2 rows in set (0.00 sec)
  9. mysql> show encrypt table rule t_encrypt from encrypt_db;
  10. +-----------+--------------+---------------+--------------+----------------+-------------------------+
  11. | table | logic_column | cipher_column | plain_column | encryptor_type | encryptor_props |
  12. +-----------+--------------+---------------+--------------+----------------+-------------------------+
  13. | t_encrypt | order_id | order_cipher | NULL | MD5 | |
  14. | t_encrypt | user_id | user_cipher | user_plain | AES | aes-key-value=123456abc |
  15. +-----------+--------------+---------------+--------------+----------------+-------------------------+
  16. 2 rows in set (0.00 sec)