+------------------------+
Jasypt Users List
http://www.jasypt.org
+------------------------+
Hello,
Are you storing the encrypted data into a database? a typical scenario
for this error is encrypted data being corrupted during storage or
transport (for example, because of a too short database column, or
because of bad character encoding when transmitting via HTTP.
Regards,
Daniel.
skadiy000 wrote:
> +------------------------+
> Jasypt Users List
>
http://www.jasypt.org
> +------------------------+
>
>
> ------------------------------------------------------------------------
>
> Dear All I am encrypting and decrypting a logging password. IF I am
> decrypting immediately after encrypting, the decryted value is fine
> and no exception is thrown. But if I am logging using the newly
> created username and password, I am getting the exception:
> org.jasypt.exceptions.EncryptionOperationNotPossibleException I have
> seen the notes in FAQ for this exception and did my best to fix the
> issue and could not. Appreciate help. My code: Encryption:
> StandardPBEStringEncryptor pwEncrypt = new
> StandardPBEStringEncryptor();
> pwEncrypt.setPassword(mdhDashUser.getPassword());
> pwEncrypt.setAlgorithm("PBEWithMD5AndDES"); RandomSaltGenerator salt =
> new RandomSaltGenerator(); salt.includePlainSaltInEncryptionResults();
> // salt.setSalt("8"); pwEncrypt.setSaltGenerator(salt);
> pwEncrypt.setProvider(Security.getProvider("SunJCE"));
> pwEncrypt.setKeyObtentionIterations(2000);
> mdhDashUser.setPassword(pwEncrypt.encrypt(mdhDashUser
> .getPassword())); logger.debug("pw encrypted:" +
> mdhDashUser.getPassword() + ", pw decrypted: " +
> pwEncrypt.decrypt(mdhDashUser.getPassword())); Decryption:
> StandardPBEStringEncryptor pwDecrypt = new
> StandardPBEStringEncryptor(); if (userDetails != null &&
> userDetails.getPassword() != null)
> pwDecrypt.setPassword(userDetails.getPassword());
> pwDecrypt.setAlgorithm("PBEWithMD5AndDES"); RandomSaltGenerator salt =
> new RandomSaltGenerator(); pwDecrypt.setSaltGenerator(salt);
> pwDecrypt.setProvider(Security.getProvider("SunJCE"));
> pwDecrypt.setKeyObtentionIterations(2000); pwDecrypt.initialize(); if
> (pwDecrypt.isInitialized()) { logger.debug("decrypting password...." +
> userDetails.getPassword()); decryptedPw =
> pwDecrypt.decrypt(userDetails.getPassword()); } if (decryptedPw !=
> null) { logger.debug("Decrypted Password from DB: " + decryptedPw);
> userDetails.setPassword(decryptedPw); } else { logger.debug("password
> not decrypted....."); }
> ------------------------------------------------------------------------
> View this message in context:
> org.jasypt.exceptions.EncryptionOperationNotPossibleException
> <
http://www.nabble.com/org.jasypt.exceptions.EncryptionOperationNotPossibleException-tp21593682s21332p21593682.html>
> Sent from the Jasypt - Users mailing list archive
> <
http://www.nabble.com/Jasypt---Users-f21330.html> at Nabble.com.
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
>
http://p.sf.net/sfu/sf-spreadtheword> ------------------------------------------------------------------------
>
> _______________________________________________
> jasypt-users mailing list
> jasypt-users@lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/jasypt-users>
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword_______________________________________________
jasypt-users mailing list
jasypt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasypt-users