klboke commented on pull request #5766:
URL: https://github.com/apache/shardingsphere/pull/5766#issuecomment-633003293


   > I don't think it's a good idea to lift the initialization into `init`, 
`javax.crypto.Cipher` is not thread-safe and the method 
`org.apache.shardingsphere.encrypt.strategy.impl.AESEncryptor#encrypt` is 
definitely possible to be called by multiple threads, you'd better keep it as 
is, or at least put it into `ThreadLocal`
   
   After the thread shares the instance, there is indeed a thread safety 
problem. Do you have more detailed documentation on the thread safety of 
javax.crypto.Cipher?
   


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


Reply via email to