ulisesbocchio / jasypt-spring-boot

Jasypt integration for Spring boot
MIT License
2.88k stars 516 forks source link

Feature request for jasypt-maven-plugin: Re-encrypt with new settings #214

Closed springfan closed 4 years ago

springfan commented 4 years ago

In order to re-encrypt all credentials with a new password I have to: 1) Decrypt all credentials (one command thanks to jasypt-maven-plugin) 2) Surround all to be encrypted strings with DEC() 3) Encrypt all credentials (one command thanks to jasypt-maven-plugin)

It would be great if the plugin could output all decrypted credentials with DEC() or to take over of the whole process and provide a command to re-encrypt all previously encrypted strings with a new password / jasypt settings.

springfan commented 4 years ago

It looks like the default decrypt output does already put the values inside DEC(). That's contrary to the README that states:

Which would output the decrypted contents to the screen: sensitive.password=ENC(encrypted) regular.property=example

It should state:

Which would output the decrypted contents to the screen: sensitive.password=DEC(unencrypted) regular.property=example

rupert-madden-abbott commented 4 years ago

@springfan I've pushed a PR that implements your request.

I figured there were two main use cases:

If you want to see if these fit your requirements, you can checkout the branch associated with the PR from my fork, then install with mvn install, then update your project to use version 3.0.3-SNAPSHOT. The README has been updated to explain how to use.

Any feedback is welcome.

I've also fixed the documentation issue you raised.