spring-cloud-cli
spring-cloud-cli copied to clipboard
encrypt/decrypt without JCE Unlimited Strength error could be improved
$ 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.
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.