spring-cloud-cli icon indicating copy to clipboard operation
spring-cloud-cli copied to clipboard

encrypt/decrypt without JCE Unlimited Strength error could be improved

Open william-tran opened this issue 7 years ago • 1 comments

$ spring encrypt "cli encrypted value" --key foobar
Unable to initialize due to invalid secret key

It would be nice to have a better error message suggesting to the user that they need to deal with JCE Unlimited Strength policy files. Or don't use JCE at all and build up an equivalent TextEncryptor using the Bouncy Castle implementations instead.

william-tran avatar Jan 25 '17 18:01 william-tran

According to https://golb.hplar.ch/2017/10/JCE-policy-changes-in-Java-SE-8u151-and-8u152.html unlimited strength can enabled by a single line of code without any additional downloads:

Security.setProperty("crypto.policy", "unlimited");

Alternatively you can also uncomment #crypto.policy=unlimited in <jre_home>/lib/security/java.security.

Since Java 8 update 162 no changes are required, since from that update unlimited strength is enabled by default.

breun avatar Oct 08 '18 14:10 breun