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 2020/02/20 07:26:34 UTC

[GitHub] [incubator-shardingsphere] xiaoma20082008 opened a new issue #4382: Will the class Encryptor add two methods contains table and column?

xiaoma20082008 opened a new issue #4382: Will the class Encryptor add two methods contains table and column?
URL: https://github.com/apache/incubator-shardingsphere/issues/4382
 
 
   Our company use the encrypt for field's encryption and decryption, but we cannot customize only by class Encryptor without table and column. So I expect the Encryptor class like this class
   ```java
   public interface Encryptor {
       void init();
       String decrypt(String cipherText);
       Object decrypt(String cipherText);
       // add the follow methods
       String decrypt(String table, String column, String cipherText);
       Object decrypt(String table, String column, String cipherText);
   }
   ```
   And replaced all the internal method call with this.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero commented on issue #4382: Will the class Encryptor add two methods contains table and column?

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #4382: Will the class Encryptor add two methods contains table and column?
URL: https://github.com/apache/incubator-shardingsphere/issues/4382#issuecomment-589933709
 
 
   Hi @xiaoma20082008 
   The responsibility of `Encryptor` is only to `encrypt(xxx)` and `decrypt(xxx)`, and there is no need for `Encryptor` to understand what the column and table are. Notice, it is just a `encryptor`.
   If you wish to use different `encryptor` with different property `aes.key.value`, you can make good use of configuration, e.g,
   ```
   encryptRule:
     encryptors:
       encryptor_aes1:
         type: aes
         props:
           aes.key.value: 123
       encryptor_aes2:
         type: aes
         props:
           aes.key.value: abc
     tables:
       t_encrypt:
         columns:
           user_id:
             plainColumn: user_plain
             cipherColumn: user_cipher
             encryptor: encryptor_aes1
           order_id:
             cipherColumn: order_cipher
             encryptor: encryptor_aes2
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] xiaoma20082008 edited a comment on issue #4382: Will the class Encryptor add two methods contains table and column?

Posted by GitBox <gi...@apache.org>.
xiaoma20082008 edited a comment on issue #4382: Will the class Encryptor add two methods contains table and column?
URL: https://github.com/apache/incubator-shardingsphere/issues/4382#issuecomment-589574863
 
 
   The AESShardingEncryptor interface's methods (`encrypt` and `decrypt`) should transfer tableName and columnName  just like my code above !

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] xiaoma20082008 commented on issue #4382: Will the class Encryptor add two methods contains table and column?

Posted by GitBox <gi...@apache.org>.
xiaoma20082008 commented on issue #4382: Will the class Encryptor add two methods contains table and column?
URL: https://github.com/apache/incubator-shardingsphere/issues/4382#issuecomment-590026116
 
 
   Thank you,I'll try it @tristaZero 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] xiaoma20082008 commented on issue #4382: Will the class Encryptor add two methods contains table and column?

Posted by GitBox <gi...@apache.org>.
xiaoma20082008 commented on issue #4382: Will the class Encryptor add two methods contains table and column?
URL: https://github.com/apache/incubator-shardingsphere/issues/4382#issuecomment-589574863
 
 
   > @xiaoma20082008
   > Hi, what you expected is to use different AESShardingEncryptors for different columns of the same table?
   The AESShardingEncryptor interface's methods about encrypt and decrypt should transfer tableName and columnName  just like my code above !

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero commented on issue #4382: Will the class Encryptor add two methods contains table and column?

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #4382: Will the class Encryptor add two methods contains table and column?
URL: https://github.com/apache/incubator-shardingsphere/issues/4382#issuecomment-589500551
 
 
   @xiaoma20082008 
   Hi, what you expected is to use different AESShardingEncryptors for different columns of the same table?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero closed issue #4382: Will the class Encryptor add two methods contains table and column?

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #4382: Will the class Encryptor add two methods contains table and column?
URL: https://github.com/apache/incubator-shardingsphere/issues/4382
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services