-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[#2421] bugfix: restored ability to match passwords from Shiro 1.x that have … #2475
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
base: main
Are you sure you want to change the base?
Conversation
|
@bmarwell is it true that Argon and BCrypt do not use private salt? Or is private salt needs to be added to the new algorithms as well? |
|
Hi, no salt needs to be nor can be supplied by the user. See: The reason: argon2 and bcrypt and scrypt are NOT general purpose hashes. Hashes are meant to be fast, eg for checking data integrity. They were never meant to be used for passwords. This and adding a salt was always some kind of misuse and workaround. General purpose hashes: meant to be fast. Adding a salt protects against rainbow tables when misused for passwords. And that's why they need so many rounds. Password hashing algorithms (like scrypt, argon 2): meant to be memory hard or CPU hard or both, slow. Specifically for protecting passwords. Usually creating a random hash internally. So, yeah, don't supply user hashes. For the API, just ignore them. Add to the Java doc that they will be ignored for modern functions. sha1, md5 etc are to be removed in the future for this reason. |
|
Thanks! |
crypto/hash/src/main/java/org/apache/shiro/crypto/hash/ConfigurableHashService.java
Show resolved
Hide resolved
core/src/main/java/org/apache/shiro/authc/credential/DefaultPasswordService.java
Show resolved
Hide resolved
core/src/main/java/org/apache/shiro/authc/credential/DefaultPasswordService.java
Outdated
Show resolved
Hide resolved
crypto/hash/src/main/java/org/apache/shiro/crypto/hash/DefaultHashService.java
Outdated
Show resolved
Hide resolved
crypto/hash/src/main/java/org/apache/shiro/crypto/hash/DefaultHashService.java
Outdated
Show resolved
Hide resolved
|
@bmarwell great feedback, I will make it so |
…private salt
fixes #2421
Following this checklist to help us incorporate your contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a GitHub issue. Your pull request should address just this issue, without pulling in other changes.
[#XXX] - Fixes bug in SessionManager,where you replace
#XXXwith the appropriate GitHub issue. Best practiceis to use the GitHub issue title in the pull request title and in the first line of the commit message.
fixes #XXXif merging the PR should close a related issue.mvn verifyto make sure basic checks pass. A more thorough check will be performed on your pull request automatically.Trivial changes like typos do not require a GitHub issue (javadoc, comments...).
In this case, just format the pull request title like
[DOC] - Add javadoc in SessionManager.If this is your first contribution, you have to read the Contribution Guidelines
If your pull request is about ~20 lines of code you don't need to sign an Individual Contributor License Agreement
if you are unsure please ask on the developers list.
To make clear that you license your contribution under the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.