Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#298 added configurable algorithm. #332

Merged
merged 10 commits into from
Apr 12, 2021
Merged

#298 added configurable algorithm. #332

merged 10 commits into from
Apr 12, 2021

Conversation

sujith-mn
Copy link
Member

@sujith-mn sujith-mn commented Jan 5, 2021

Implements issue #71 (update doc for password encryption with secure algorithm for jasypt) and replaces PR #298.

@sujith-mn sujith-mn requested a review from hohwille January 5, 2021 06:08
Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For #71 my expecation would be:

  • we understand why the default algorithm is flawed and should be discouraged - if noone can clarify this and improve documentation on password encryption for strong encryption #71 is invalid, we should simply cose it. Otherwise we need to take action with the next points.
  • we understand what algorithm should be our best-practice
  • we practically proof the usage with the new algorithm on a running example application
  • we change this documentation with concrete steps so all steps and example configs and outputs match to the new algorithm

[source, bash]
----
----ARGUMENTS-------------------
----- ARGUMENTS ```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this valid AsciiDoc?
Either

[source, «type»]
---

or

\```

will start a code block.

If you did rerun jasypt with more recent algorithm you are more than welcome to replace this output examples here. However, I do not understand these changes here...

Comment on lines 200 to 213
==== Configure Algorithm
Algorithm can be configured for stronger encryption. Jasypt uses PBEWITHHMACSHA512ANDAES_256 as the Default encryption algorithm.
Algorithm can be configured through System, properties file, command line argumments, environment variable etc.

[source, java]
----
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
String privateData = "secret-password-to-encrypt";
encryptor.setPassword("master-password");
encryptor.setAlgorithm("PBEWithMD5AndTripleDES");
String encryptedText = encryptor.encrypt(privateData);
----

Other configurable properties can be found https://github.com/ulisesbocchio/jasypt-spring-boot#password-based-encryption-configuration[here]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice improvement. Still it is unclear what to do? Which algorithm should we use now?

@hohwille hohwille changed the base branch from develop to master January 7, 2021 15:55
Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sujith-mn thanks for your updates. I am approving. However, I still have one concern:
If we override the encryption algorithm manually in the jasypt CLI we IMHO also have to configure that in springs application.properties, right?
Did you test this and ensure that the password can be decrypted by the devon4j template application following this guide?

Otherwise if the new version of Jasypt has changed the encryption algorithm, do we still need to provide it in the jasypt CLI?

Appart from this last point this is ready for merge.

@sujith-mn
Copy link
Member Author

sujith-mn commented Apr 5, 2021

If we override the encryption algorithm manually in the jasypt CLI we IMHO also have to configure that in springs application.properties, right?

Yes, if other than default algorithm required, it needs to be used in the CLI, it has to be configured in the application.properties.

Did you test this and ensure that the password can be decrypted by the devon4j template application following this guide?

Yes

Otherwise if the new version of Jasypt has changed the encryption algorithm, do we still need to provide it in the jasypt CLI?

If the algorithm is not provided in the CLI, jasypt considers the default algorithm.

@hohwille hohwille merged commit 49bbc4b into devonfw:master Apr 12, 2021
@hohwille hohwille linked an issue Apr 12, 2021 that may be closed by this pull request
@hohwille hohwille added this to the release:2021.04.001 milestone Apr 12, 2021
@hohwille hohwille added configuration config files (application.properties, etc.) documentation Guides, tutorials, readmes, etc. enhancement New feature or request security labels Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration config files (application.properties, etc.) documentation Guides, tutorials, readmes, etc. enhancement New feature or request security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve documentation on password encryption for strong encryption
3 participants