-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support for Balloon Hashing #131
Comments
Hi @Colerar, thank you for your interest in the project! I'm reviewing the paper and the implementations you provided and see if there is any industry standard. |
@firaja any news? When will it get implemented? |
Hi @BigPanda97 the implementation is in progress. |
That's absolutely okay, but nice to hear that it will get implemented. 😊 |
Hi @Colerar @BigPanda97, in this branch you can find a preview version of Balloon Hashing: https://github.com/Password4j/password4j/tree/bal If you can test it along with the implementation you are using it would be great. Here a quick usage guide for mono thread version ( // parameters:
// - algorithm name
// - space cost
// - time cost
// - parallelism
// - delta
BalloonHashingFunction balloonHashingFunction = BalloonHashingFunction.getInstance("SHA-256", 16, 20, 0, 4);
Hash hash = Password.hash("buildmeupbuttercup").addSalt("JqMcHqUcjinFhQKJ").with(balloonHashingFunction);
hash.getResult(); // 2ec8d833db5f88e584ab793950ecfb21657a3816edea8d9e73ea23c13ba2b740 and there the M-thread version ( BalloonHashingFunction balloonHashingFunction = BalloonHashingFunction.getInstance("SHA-256", 16, 20, 7, 4);
Hash hash = Password.hash("buildmeupbuttercup").addSalt("JqMcHqUcjinFhQKJ").with(balloonHashingFunction);
hash.getResult(); // 1c271e9069cb694ba5ae9d3da1f57be4614063e014410e7c484d7b47f8291bac TODO:
|
It looks like a new thread pool is created every time a hash is calculated. So the multi-threaded version may be slower than the non-multi-threaded version. 🤔 |
@Colerar do you suggest to make the thread pool shared among all the instances of |
Yes, shared thread pool is reasonable. |
Hi @Colerar I've updated the PR with a instance-shared forever-living thread pool. |
This feature is now present in 1.8.0 |
Balloon hashing (Wikipedia), is similar to Argon2, which has proven memory-hardness properties. But it claims to match the performance of similar algorithms. It seems easy to implement. And it is recommended by NIST password guidelines.
There are Rust and Python implementations for references.
Balloon actually wraps existing hash functions, so we may need a generic type over
MessageDigest
for any standards non-space-hard cryptographic hash function.The text was updated successfully, but these errors were encountered: