-
Notifications
You must be signed in to change notification settings - Fork 120
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
Replace bcrypt hashing with blake3 for improved performance #1030
Conversation
Hi @mrpriv4te, thanks for the PR. One thing holding me back from merging this: |
After further testing, I realized that the time saving was not significant, so I opted for sha256, which is faster.
If you want to reproduce the latency, add several users (12 in my case) to Alarmo and try arming or disarming with the code of the last user created.
I totally agree with you, and now it's done. |
@mrpriv4te please don't just use plain SHA256 without salting because a password will be much easier to reverse from known hashes or by using a rainbow table. The original |
Hi @marazmarci, thanks for your feedback ! I've now added salting to the password hash, and I've replaced sha256 with blake3, which is not vulnerable to length extension attack. There's still one problem, blake3's python module needs rust/cargo and gcc to build, but I don't know how an HA integration can install these dependencies. |
Remove unused const
@mrpriv4te Following the discussion I'm not confident we should change the current password encryption. I also think there is not much benefit to this change for other users. If you still want to see this PR merged, I would like this change to be reviewed by multiple people who have experience with encryption methods. |
Hi @nielsfaber, I totally understand, I'll use my fork on my side. |
Hi nielsfaber! I made this change because the bcrypt hash function was too slow, and with several users and codes on my installation, I observed delays of 5-10s to verify the pincode/password.