Caused by: org.jasypt.exceptions.EncryptionOperationNotPossibleException: Encryption raised an exception

29 views Asked by At

Followed below steps to encrypt the secret, however facing below issue.

  1. Add the dependency in your parent pom :

    com.github.ulisesbocchio jasypt-spring-boot-starter 3.0.3
  2. Add also the maven plugin just to encrypt the password(s) (it could be removed once the passwords are generated) :

    com.github.ulisesbocchio jasypt-maven-plugin 3.0.3
  3. Encrypt your client-secret using the maven plugin :

    mvn jasypt:encrypt-value "-Djasypt.encryptor.password=secretKey" "-Djasypt.plugin.value=secret"

Issue:

"Caused by: org.jasypt.exceptions.EncryptionOperationNotPossibleException: Encryption raised an exception. A possible cause is you are using stronenter code hereg encryption algorithms and you have not installed the Java Cryptography Extension (JCE ) Unlimited Strength Jurisdiction Policy Files in this Java Virtual Machine".

1

There are 1 answers

0
Vasanthakumar Jagannathan On

Resolution:

As the exception indicates one need to install the latest JCE Policy Jar Files into your JAVA setup.

  1. Download the JCE Policy jar files from the below location: (since my java version is 8 I choose javase-jce8-downloads.html, please download correct jce files based on your java version)

    https://www.oracle.com/java/technologies/javase-jce8-downloads.html

  2. The zip file would contain two jar files (local_policy.jar and US_export_policy.jar).

  3. These jar files need to be placed under the following location:

    %JAVA_HOME%\jre\lib\security\

Reference : https://technofes.blogspot.com/2011/10/orgjasyptexceptionsencryptionoperationn.html