-
Notifications
You must be signed in to change notification settings - Fork 43
argon2id password hash #113
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
Conversation
|
@jiacai2050, could you please review and help me fix these failing checks. Thank you |
The logs already tell you what went wrong: https://github.com/zigcc/zig-cookbook/actions/runs/17290154717/job/49075399319?pr=113 You need to define a main method. |
src/en-US/02-03-argon2.smd
Outdated
| @@ -0,0 +1,14 @@ | |||
| --- | |||
| .title = "Argon2 Password Hash", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to update the toc.md file to include this recipe.
|
Hi, I think it is good now to proceed to be merged. Thank you |
src/en-US/02-03-argon2.smd
Outdated
| --- | ||
| Argon2 Password Hash | ||
|
|
||
| This Zig program derives a cryptographic key from a password and salt using the Argon2id password hashing algorithm. It uses [std.crypto.pwhash.argon2] to hash a salted password, where the salt is generated using [std.rand.DefaultPrng] to ensure randomness. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The salt is hardcoded, not generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is purposely hardcoded for testing using testing.expectEqualStrings. May be, I should update the description in 'src/en-US/02-03-argon2.smd' file stating the same. (hardcoded for unit testing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need that test, we can just print the hashed password
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will make this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done
Co-authored-by: Jiacai Liu <dev@liujiacai.net>
src/en-US/02-03-argon2.smd
Outdated
| .author = "gmcodentech", | ||
| .layout = "section.shtml", | ||
| --- | ||
| Argon2 Password Hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected these lines. Please let me know if any particular line should be deleted. Thanks again!
Hello, I want to add this example in the section of Cryptography. As the 'Argon2' is a powerful and popular algorithms, I think adding this would be really helpful for all zig learners.