org.jasypt.exceptions.EncryptionOperationNotPossibleException

前端 未结 5 1680
无人共我
无人共我 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:16

    If you don't specifiy all the params during encryption, Jasypt will use default values. Make sure to use those exact default values during decryption. Otherwise you may have troubles...

    This work for me:

    mvn jasypt:encrypt -Djasypt.encryptor.password='secret' \
        -Djasypt.encryptor.algorithm=PBEWITHHMACSHA512ANDAES_256 \
        -Djasypt.encryptor.iv-generator-classname=org.jasypt.iv.RandomIvGenerator \
        -Djasypt.encryptor.salt-generator-classname=org.jasypt.salt.RandomSaltGenerator \
        -Djasypt.encryptor.key-obtention-iterations=1000  \
        -Djasypt.plugin.path='file:application.yml' 
    
    mvn jasypt:decrypt -Djasypt.encryptor.password='secret' \
        -Djasypt.encryptor.algorithm=PBEWITHHMACSHA512ANDAES_256 \
        -Djasypt.encryptor.iv-generator-classname=org.jasypt.iv.RandomIvGenerator \
        -Djasypt.encryptor.salt-generator-classname=org.jasypt.salt.RandomSaltGenerator \
        -Djasypt.encryptor.key-obtention-iterations=1000  \
        -Djasypt.plugin.path='file:application.yml' 
    

提交回复
热议问题