wade-hong opened a new issue #13545:
URL: https://github.com/apache/shardingsphere/issues/13545


   ## Question
   
   **For English only**, other languages will not accept.
   
   Before asking a question, make sure you have:
   
   - Googled your question.
   - 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**.
   
   **Which version of ShardingSphere did you use?**
   <dependency>
       <groupId>org.apache.shardingsphere</groupId>
       <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
       <version>4.1.1</version>
   </dependency>
   
   **Expected behavior**
   Data Masking can be successfully encrypted and decrypted.
   
   **Actual behavior**
   Data Masking was successfully encrypted, but decryption failed.
   
   **Reason analyze (If you can)**
   
   Configuration
   ```
   spring:
     shardingsphere:
       datasource:
         name: db-master1,db-slave1
         db-master1:
           type: com.alibaba.druid.pool.DruidDataSource
           driverClassName: com.mysql.jdbc.Driver
           url: 
jdbc:mysql://192.168.8.162:3306/test?characterEncoding=utf8&allowMultiQueries=true&useSSL=false
           username: xxx
           password: xxx
         db-slave1:
           type: com.alibaba.druid.pool.DruidDataSource
           driverClassName: com.mysql.jdbc.Driver
           url: 
jdbc:mysql://192.168.8.163:3306/test?characterEncoding=utf8&allowMultiQueries=true&useSSL=false
           username: xxx
           password: xxx 
       sharding:
         default-data-source-name: db_ms_0
         master-slave-rules:
           db_ms_0:
             masterDataSourceName: db-master1
             slaveDataSourceNames: db-slave1
             loadBalanceAlgorithmType: round_robin
         tables:
           t_user:
             actual-data-nodes: db_ms_0.T_USER_${0..31}
             table-strategy:
               standard:
                 precise-algorithm-class-name: 
com.demo.shardingjdbc.MyTablePreciseShardingAlgorithm
                 sharding-column: USER_ID
           t_sub_user:
             actual-data-nodes: db_ms_0.T_SUB_USER_${0..31}
             table-strategy:
               standard:
                 precise-algorithm-class-name: 
com.demo.shardingjdbc.MyTablePreciseShardingAlgorithm
                 sharding-column: SUB_USER_ID
         encrypt-rule:
           encryptors:
             encryptor_aes:
               type: aes
               props:
                 aes.key.value: 123456
           tables:
             t_user:
               columns:
                 EMAIL:
                   plainColumn: EMAIL
                   cipherColumn: EMAIL_CIPHER
                   encryptor: encryptor_aes
       props:
         query.with.cipher.column: true
   ```
   
   **SQL**
   
   Update SQL:
   
   ```
   Logic SQL: update t_sys_user_a set NAME = ?, EMAIL_CIPHER = ?, EMAIL = ? 
WHERE USER_ID = ? 
   
   Actual SQL: update t_sys_user_a set NAME = ?, EMAIL_CIPHER = ?, EMAIL = ? 
WHERE USER_ID = ? ::: [Tom, KF7nmnmnmSDFSDFKUHH3789D8SVXVSD, 111111@email, 
fdfdfdsfa8dfdssaf6ddfsdfa7fsdfassd]
   ```
   
   
   Query SQL:
   
   ```
   Logic SQL: select EMIAL from t_sys_user_a  where USER_ID = ?
   
   Actual SQL: select **EMIAL** from t_sys_user_a  where USER_ID = ?
   ```
   
   **Question**
   With _query.with.cipher.column: true_ configuration, Write operations can 
generate plainColumn and cipherColumn, but query operations cannot return 
cipherColumn.
   
   **Due to the tight schedule of the project, it is expected to be resolved in 
this release (4.1.1)**
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to