Y-sir opened a new issue, #34152:
URL: https://github.com/apache/shardingsphere/issues/34152

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot reproduce it on current information, we 
will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.5.1
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   ### Expected behavior
   After using distsql to create encryption rules, the data can be converted to 
ciphertext when inserted in the proxy, but when querying, the ciphertext is 
still queried in the proxy. Under normal conditions, it should be plaintext.
   ### Actual behavior
   The query in the proxy is plain text
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   
   1、Create a table called xxl_job_user
   
   `CREATE TABLE `xxl_job_user` (
     `id` int NOT NULL AUTO_INCREMENT,
     `username` varchar(50) NOT NULL COMMENT '账号',
     `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT 
NULL COMMENT '密码',
     `role` tinyint NOT NULL COMMENT '角色:0-普通用户、1-管理员',
     `permission` varchar(255) DEFAULT NULL COMMENT '权限:执行器ID列表,多个逗号分割',
     PRIMARY KEY (`id`) USING BTREE,
     UNIQUE KEY `i_username` (`username`) USING BTREE
   ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3;`
   
   
   2、Use distsql statements to create encryption rules for the password field
   
   `CREATE ENCRYPT RULE xxl_job_user (
     COLUMNS ((
         NAME = `password`,
         CIPHER = `password`,
         ENCRYPT_ALGORITHM (
           TYPE (
           NAME = 'AES',
   PROPERTIES ( 'aes-key-value' = '123456abc', 'digest-algorithm-name' = 
'SHA-1'))))));`
   
   
   3、Insert a piece of data into the proxy
   
   `INSERT INTO `xxx`.`xxl_job_user` ( `id`, `username`, `password`, `role`, 
`permission` )
   VALUES
     ( 4, 'admin1', '123456', 1, NULL );`
   
   
   4、Query data in proxy
   
   `SELECT * FROM `xxx`.`xxl_job_user` LIMIT 0,1000`
   
   
   5、The data queried in the proxy should be 123456, but the queried data is 
encrypted data.
   
   
![image](https://github.com/user-attachments/assets/303b124c-23ba-4514-9b36-65183a034dc3)
   
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
notifications-unsubscr...@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to