[DB] Research user account management #148
Labels
No labels
_CRITICAL_
API
app
backEnd
Blocked, waiting for further changes
bug
cleanup
close
design
duplicate
enhancement
feature request
frontEnd
help wanted
invalid
low priority
needs input
needs review
project documentation
question
research
reviewed
script
security
SQL
style
testing
topLevel
wontfix
No milestone
No project
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Andras/BoundlessFlowCampus2K#148
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
How should we store account information in a primarily safe, but also efficient manner.
Parent Issues: #1 #9 #11
Related Issues: #143 #141
I just want to name-drop JWT tokens here for future discussion on the subject
This is more focused on how we can store and handle the data rather then how its transmitted:
Account credentials are stored in a standard user table with for example an ID as a unique identifier and email as a login identifier. But we should not store passwords directly rather we should instead, hash each password using a random salt and a slow hashing algorithm such as Argon2, bcrypt or PBKDF2. This approach means that we only store the resulting hash, the salt used to generate it and the parameters of the hashing algorithm.
Since hashing is one-way, the original password cannot be recovered even if the database is compromised and the use of a unique salt for every user will prevent "rainbow table attacks" and slow hashing algorithms make brute-force attempts expensive for an attacker while remaining efficient for normal authentication.
During login, the system gets the stored salt and hashing parameters, then hashes the password entered by the user using the same method and then compares the result to the stored hash. If the values match, the user is successfully authenticated without ever exposing or storing the actual password.
assign me
I have reviewed the researched solution regarding secure account information storage.
The research is good and follows a standard security practices for storing credentials.
It would be good to specify the advantages and disadvantages of using Argon2, bcrypt, and PBKDF2, and also suggest a preferred option and why.
Additionally, the efficiency aspect mentioned in the issue is not addressed, it would be good to add something about how to increase efficiency, such as tuning hashing cost.
Argon2 (Argon2id)
Advantages
Disadvantages
bcrypt
Advantages
Disadvantages
PBKDF2
Advantages
Disadvantages
Preferred option:
Argon2id is probably to recommend as the most suitable algorithm specifically (Argon2id), as it is designed to be resistant to both GPU and ASIC attacks, making large-scale brute-force attacks significantly more expensive for an attacker than bcrypt or PBKDF2.
bcrypt can be an acceptable alternative incase Argon2id is not available as Argon2id is newer and don't support very old libraries and legacy systems. And PBKDF2 should only be used when required.
Performance
Slow hashing algorithms add intentional computational costs to protect from brute-force attacks, however this cost must be balanced to avoid degrading the performance off authentication for the users.
Argon2id is suitable here as well as it allows the tuning of its cost parameters specifically memory cost, time (iterations) cost and parallelism.
To balance the security and performance we can set some "hard" rules such as:
Links used during research:
Recommending the last link if you want to read and understand the differences quickly.
What is bcrypt
What is Argon2
Password Hashing: Scrypt, Bcrypt and ARGON2
Complete Guide to PBKDF2 vs bcrypt vs Argon2 for Password Hashing
I've reviewed ways to store passwords safely and efficiently in DB
There are different methods that are compared to each other, which is good. There is also a preferred method which is appropriately motivated. Good suggestions with the rules for optimal performance.
Could have been good to write a bit about how the different methods work and not only the pros and cons, but by reading the links one can figure it out. Am wondering a bit about protection of other data other than passwords, for example if we are storing emails for teachers? How do we keep that safe?
Good points.
How they work
Other sensitive data such as emails.
Sounds like good research! I have nothing more to add
Review seems to have been done in a proper maner, i will close this issue. Good job!