Skip to content

Clarify password hashing rationale and algorithm selection#1993

Open
Angelmendiratta wants to merge 4 commits intoOWASP:masterfrom
Angelmendiratta:clarify-password-hashing
Open

Clarify password hashing rationale and algorithm selection#1993
Angelmendiratta wants to merge 4 commits intoOWASP:masterfrom
Angelmendiratta:clarify-password-hashing

Conversation

@Angelmendiratta
Copy link

This PR improves clarity in the Password Storage Cheat Sheet by explaining why password hashing must be slow, clarifying how to choose between recommended algorithms, and simplifying the explanation of configuration parameters.

Scope:

  • Documentation-only change
  • Single file modified
  • No changes to recommendations or configuration values


Three hashing algorithms that should be considered:

When selecting a password hashing algorithm, developers should prefer modern algorithms that are designed to resist both GPU-based and memory-based attacks.
Copy link
Member

Choose a reason for hiding this comment

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

Please put this ABOVE the "three hashing" phrase

Three hashing algorithms that should be considered:

When selecting a password hashing algorithm, developers should prefer modern algorithms that are designed to resist both GPU-based and memory-based attacks.
Where available, newer algorithms should be chosen for new applications, while older algorithms may still be acceptable for legacy systems with appropriate configuration.
Copy link
Member

Choose a reason for hiding this comment

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

Please put this ABOVE the "three hashing" phrase

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review! I’ve reordered the text as suggested.

@Angelmendiratta
Copy link
Author

I’ve addressed the review feedback and verified that "npm run lint-markdow" passes locally.
The CI workflows appear to be awaiting maintainer approval, could someone please approve and run them?

Since **encryption is a two-way function**, attackers can retrieve the original plaintext from the encrypted data. It can be used to store data such as a user's address since this data is displayed in plaintext on the user's profile. Hashing their address would result in a garbled mess.

The only time encryption should be used in passwords is in edge cases where it is necessary to obtain the original plaintext password. This might be necessary if the application needs to use the password to authenticate with another system that does not support a modern way to programmatically grant access, such as OpenID Connect (OIDC). Wherever possible, an alternative architecture should be used to avoid the need to store passwords in an encrypted form.
The only time encryption should be used in passwords is in edge cases where it is necessary to obtain the original plaintext password. This might be necessary if the application needs to use the password to authenticate with another system that does not support a modern way to programmatically grant access, such as OpenID Connect (OIDC). Wherever possible, an alternative architecture should be used to avoid the need to store passwords in an encrypted form.
Copy link
Member

Choose a reason for hiding this comment

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

Change to:

The only time encryption alone should be used in passwords

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants