简体   繁体   中英

Crypto encryptAES and decryptAES migrated in play framework 2.6

I have an old version play framework and I migrate to play framework 2.6

In old project they used Crypto.decryptAES and Crypto.encryptAES now in play 2.6 I need to change this methods

In play framework documentation say:

These methods will be deprecated, and may be removed in future versions.

now, how can I change this methods with no conflict with previous encrypted data in play framework 2.6???

Farther down in the same section of the documentation is a migration guide :

There are several migration paths from Crypto functionality. In order of preference, they are Kalium, Keyczar, or pure JCA.

Kalium

If you have control over binaries in your production environment and do not have external requirements for NIST approved algorithms: use Kalium, a wrapper over the libsodium library....

If you want a symmetric encryption replacement for Crypto.encryptAES , then use org.abstractj.kalium.crypto.SecretBox , which implements secret-key authenticated encryption.

Note that Kalium does require that a libsodium binary be installed, preferably from source that you have verified.

Keyczar

If you are looking for a pure Java solution or depend on NIST approved algorithms, Keyczar provides a high level cryptographic library on top of JCA....

If you need a symmetric encryption replacement for Crypto.encryptAES , then use org.keyczar.Crypter .

JCA

Both Kalium and Keyczar use different cryptographic primitives than Crypto. For users who intend to migrate from Crypto functionality without changing the underlying algorithms, the best option is probably to extract the code from the Crypto library to a user level class.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM