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/08/06 15:46:50 UTC

[GitHub] [shardingsphere] cheese8 opened a new issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

cheese8 opened a new issue #11689:
URL: https://github.com/apache/shardingsphere/issues/11689


   ## Feature Request
   
   **For English only**, other languages will not accept.
   
   ### Describe the feature you would like.
   We need different key on each table/column to encrypt and decrypt with, how about add content parameters as below code, for example: logicTable, logicColumn etc? 
   
   
   `/**
    * Encryptor.
    */
   public interface Encryptor extends TypeBasedSPI {
       
       /**
        * Initialize.
        */
       void init();
       
       /**
        * Encode.
        * 
        * @param plaintext plaintext
        * @param encryptContextMap encrypt context map(logicTable and logicColumn)
        * @return ciphertext
        */
       String encrypt(Object plaintext, **Map<String, Object> encryptContextMap**);
       
       /**
        * Decode.
        * 
        * @param ciphertext ciphertext
        * @param decryptContextMap decrypt context map(logicTable and logicColumn)
        * @return plaintext
        */
       Object decrypt(String ciphertext, **Map<String, Object> decryptContextMap**);
   }`
   
   


-- 
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] tristaZero commented on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

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


   Go ahead. ;-)


-- 
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] tristaZero edited a comment on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on issue #11689:
URL: https://github.com/apache/shardingsphere/issues/11689#issuecomment-909181938


   Go ahead. ;-) It is yours now.


-- 
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] cheese8 commented on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

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


   Hi @tristaZero , as enterprise requirements described what we should encrypt sensitive data by keys/hash sensitive data by salt, for example  1 business unit per 1 key or 1 database/schema/table/column per 1 key... and add those parameters into decrypt and decrypt context are compatible with now implements.


-- 
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] cheese8 commented on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

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


   I think it's not enough because the key/salt should be related to the databaseName/id, schema, table and plain column.


-- 
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] cheese8 closed issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

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


   


-- 
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] tristaZero commented on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

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


   Go ahead. ;-)


-- 
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] tristaZero edited a comment on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on issue #11689:
URL: https://github.com/apache/shardingsphere/issues/11689#issuecomment-909181938


   Go ahead. ;-) It is yours now.


-- 
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] tristaZero commented on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

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


   Hi @cheese8 Sorry for my late response. I am interested in your issue. Could I know why you want to add new parameters to these interfaces?


-- 
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] tristaZero edited a comment on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on issue #11689:
URL: https://github.com/apache/shardingsphere/issues/11689#issuecomment-904480966


   That way, do you think the properties of an encryption implement for this interface are enough? e.g., `AES_KEY = "aes-key-value"` of `AESEncryptAlgorithm`.
   If I do not reply promptly, you can send your WeChat number to my email (panjuan@apache.org) as to discuss this interesting 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] tristaZero commented on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

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


   Go ahead. ;-)


-- 
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] tristaZero commented on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

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


   Hi @cheese8 ,
   
   Thanks for your explanation. I am on your side! The following enhancement looks good to me. I know some users implement this interface for their scenarios, but
   - We have some default implements for users' choice
   - Your proposal does not change the API for encrypting configuration
   - It's a great enhancement for the encryption feature
   - Avoid complicated judgment and handling in our project
   
   Based on these reasons, I prefer to do direct modification to the previous interface. What do you think? @cheese8 I am looking forward to this wonderful enhancement! I assigned this issue to you, if you think we need more other discussion, please speak up here.
   
   ```
   String encrypt(Object plaintext, Map<String, Object> encryptContextMap);
   ```


-- 
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] tristaZero commented on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

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


   That way , do you think properties of an encryption implement for this interface are enough? e.g., `AES_KEY = "aes-key-value"` of `AESEncryptAlgorithm`.
   If I do not reply promptly, you can send your WeChat number to my email (panjuan@apache.org) as to discuss this interesting 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] cheese8 commented on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

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


   Thank you for encouraging me @tristaZero , I'll pr it soon as I take the below steps done
   1、migrate the implementation from shardingsphere 4.1.1 to 5.0.0-RC1-SNAPSHOT
   (I see the version of 5.0.0-RC1-SNAPSHOT was refactoring some places from the version 4.1.1)
   2、test it passed my 3 samples


-- 
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] cheese8 commented on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

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


   Not compatible, I meant that If context parameters  added, we can use it as needed, and also ignore it while not needed.


-- 
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] tristaZero edited a comment on issue #11689: [enhancement]how about add context parameters on encrypt and decrypt method

Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on issue #11689:
URL: https://github.com/apache/shardingsphere/issues/11689#issuecomment-909181938


   Go ahead. ;-) It is yours now.


-- 
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