Skip to content
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 "PHC String Format" for argon2(id) hashing #12094

Open
DavidBuchanan314 opened this issue Dec 3, 2024 · 1 comment
Open

Support "PHC String Format" for argon2(id) hashing #12094

DavidBuchanan314 opened this issue Dec 3, 2024 · 1 comment

Comments

@DavidBuchanan314
Copy link
Contributor

The reference implementation of argon2 supports an output format that encodes the hashing parameters, along with the hash itself. This is useful, for example, if you're storing password hashes in a database and you want to upgrade the parameters (or even the algorithm itself) over time.

The format is documented here: https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md

The format is supported by other argon2 libraries/implementations, including https://github.com/hynek/argon2-cffi

Similar serialisation formats exist for most hashing schemes, and passlib supports many of them (including argon2).

@DavidBuchanan314
Copy link
Contributor Author

DavidBuchanan314 commented Dec 3, 2024

Here's my first-pass implementation of PHC string parsing https://gist.github.com/DavidBuchanan314/09776258324bca75a6057b24e7e0a6ac

Edit: I found this standalone JavaScript implementation of the PHC format, may be useful for reference: https://github.com/simonepri/phc-format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant