Thursday, October 6, 2011

org.jasypt.exceptions.EncryptionOperationNotPossibleException

Many of us have come across this exception while using encryption in our functionality.

org.jasypt.exceptions.EncryptionOperationNotPossibleException: Encryption raised an excep tion. A possible cause is you are using strong encryption algorithms and you have not installed the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files in this Java Virtual Machine


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:

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 Link:

2 comments:

  1. Hi,
    I am using Java 1.5 with JBoss 4.0.5 and wrote a sample app to encrypt plain text using Jasypt 1.9 and Bouncy Castle (bcprov-jdk15on-151.jar). I keep getting the encryption operation not possible exception in spite of having the unlimited JCE policy files in the JRE lib security.

    What could be the issue?
    Thanks

    ReplyDelete
    Replies
    1. Sure you've overwritten the right java files?
      Often there are installed several java versions on a system. Maybe you're using an other version of the one you've overwritten.

      Delete