title: org.jasypt.exceptions.EncryptionOperationNotPossibleException
body: <p>I am using <strong>Jasypt-1.9.0</strong> with <strong>Spring 3.1</strong> and <strong>Hibernate 4.0.1</strong>. I have a requirement in my application to connect to database whose password(root) is stored  in the encrypted form in the property file within the application.</p>
  
  <p>I looked online and found the way with following links:</p>
  
  <ol>
  <li><p><a href="http://www.jasypt.org/spring31.html" rel="noreferrer">http://www.jasypt.org/spring31.html</a></p></li>
  <li><p><a href="http://www.jasypt.org/hibernate.html" rel="noreferrer">http://www.jasypt.org/hibernate.html</a></p></li>
  <li><p><a href="http://www.jasypt.org/encrypting-configuration.html" rel="noreferrer">http://www.jasypt.org/encrypting-configuration.html</a></p></li>
  </ol>
  
  <p>I have done the following steps and configuration for my requirement:</p>
  
  <ul>
  <li>Added <strong>jasypt-1.9.0</strong> and <strong>jasypt-hibernate4</strong>-1.9.0 in build path.</li>
  <li>Added following in my <strong>dispatcher-servlet</strong> file:</li>
  </ul>
  
  <pre><code>&lt; bean id="propertyConfigurer"
     class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer"&gt;
  
    &lt; constructor-arg ref="configurationEncryptor" /&gt;
    &lt; property name="locations"&gt;
      &lt; list&gt;
        &lt; value&gt;classpath:database.properties&lt; /value&gt;
      &lt; /list&gt;
    &lt; /property&gt;
  &lt; /bean&gt;
  
  &lt; bean id="configurationEncryptor"
      class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor"&gt;
    &lt; property name="config" ref="environmentVariablesConfiguration" /&gt;
  &lt; /bean&gt;
  
  &lt; bean id="environmentVariablesConfiguration"
      class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig"&gt;
    &lt; property name="algorithm" value="PBEWithMD5AndDES" /&gt;
    &lt; property name="passwordEnvName" value="APP_ENCRYPTION_PASSWORD" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <ul>
  <li>Using <strong>CLI tool of Jasypt 1.9.0,</strong> I have generated the password
  below(attached snapshot of CLI)</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/RWahL.png" alt="enter image description here">
   - Added a new Environment  Varibale as <strong>APP_ENCRYPTION_PASSWORD</strong> with value as <strong>root</strong></p>
  
  <ul>
  <li>Added the encrypted password in <strong>database.properties file</strong></li>
  </ul>
  
  <pre><code>db.driverClassName=com.mysql.jdbc.Driver
  db.url=jdbc:mysql://localhost:3306/db1
  db.username=root
  db.password=ENC(bmfeQmgP/hJrh+mj6NANKA==)
  </code></pre>
  
  <p>Now, if I run my application, the following exception appears:</p>
  
  <pre><code>org.jasypt.exceptions.EncryptionOperationNotPossibleException
      at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:981)
      at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725)
      at org.jasypt.properties.PropertyValueEncryptionUtils.decrypt(PropertyValueEncryptionUtils.java:72)
  </code></pre>