You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/11/10 13:37:56 UTC

[GitHub] [shardingsphere] wade-hong opened a new issue #13545: Data Masking was successfully encrypted, but decryption failed

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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] strongduanmu closed issue #13545: Data Masking was successfully encrypted, but decryption failed

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #13545:
URL: https://github.com/apache/shardingsphere/issues/13545


   


-- 
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-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] wade-hong commented on issue #13545: Data Masking was successfully encrypted, but decryption failed

Posted by GitBox <gi...@apache.org>.
wade-hong commented on issue #13545:
URL: https://github.com/apache/shardingsphere/issues/13545#issuecomment-965912856


   > @wade-hong From your configuration, t_sys_user_a does not seem to be an encryption and decryption table. Can you provide a demo? This can help me quickly locate the problem.
   
   I'm very sorry, , the previous configuration is a bit wrong, it has been corrected. This problem occurred on the company project and there was no Demo available.


-- 
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-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] strongduanmu commented on issue #13545: Data Masking was successfully encrypted, but decryption failed

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #13545:
URL: https://github.com/apache/shardingsphere/issues/13545#issuecomment-965898259


   @wade-hong Thank you for your feedback, I will check this issue.


-- 
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-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] strongduanmu commented on issue #13545: Data Masking was successfully encrypted, but decryption failed

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #13545:
URL: https://github.com/apache/shardingsphere/issues/13545#issuecomment-966005723


   @wade-hong I found out that the logical column in your query statement is wrong, not `EMIAL`, the correct one should be `EMAIL`.
   
   ![image](https://user-images.githubusercontent.com/10829171/141243821-2093d1e9-efd9-44b2-bee8-bd82201e770e.png)
   


-- 
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-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] strongduanmu commented on issue #13545: Data Masking was successfully encrypted, but decryption failed

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #13545:
URL: https://github.com/apache/shardingsphere/issues/13545#issuecomment-965906062


   @wade-hong From your configuration, t_sys_user_a does not seem to be an encryption and decryption table. Can you provide a demo? This can help me quickly locate the problem.


-- 
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-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] strongduanmu commented on issue #13545: Data Masking was successfully encrypted, but decryption failed

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #13545:
URL: https://github.com/apache/shardingsphere/issues/13545#issuecomment-977639485


   Long time no response.


-- 
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-unsubscribe@shardingsphere.apache.org

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