org.jasypt.exceptions.EncryptionOperationNotPossibleException

前端 未结 5 1847
无人共我
无人共我 2021-02-05 18:26

I am using Jasypt-1.9.0 with Spring 3.1 and Hibernate 4.0.1. I have a requirement in my application to connect to database who

5条回答
  •  梦谈多话
    2021-02-05 19:00

    I had a similar issue, but I realize when using the CLI tool and trying to decrypt the password you don't have to include the algorithm property and the password property needs to match the one used in the CLI Tool.

    In their http://www.jasypt.org/encrypting-configuration.html

    their example looks like this, but this doesn't work.

    encryptor.setPassword("jasypt"); // could be got from web, env variable... encryptor.setAlgorithm("PBEWithHMACSHA512AndAES_256"); encryptor.setIvGenerator(new RandomIvGenerator());


    Solution:

    encryptor.setPassword("MYPAS_WORD"); // Like in the CLI Tool encryptor.setAlgorithm("PBEWithHMACSHA512AndAES_256"); //Remove this encryptor.setIvGenerator(new RandomIvGenerator()); //Remove this as well

    It'll work fine.

    In your case you can remove the algorithm property and passwordEvnName needs to match the one used in CLI Tool.

提交回复
热议问题