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

WASM conversion for Argon2 hashing #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

polydeuxes
Copy link

This pull request introduces a WebAssembly (WASM) implementation for Argon2 hashing. The changes include:

  • Conversion of the Argon2 hashing process to use WebAssembly.
  • Inclusion of the argon2.js and argon2.wasm files.
  • Addition of a download-wasm.sh script to download the necessary WASM files if necessary.

Despite successfully getting the WASM implementation working, the output hash (digestion) differs from the original JavaScript implementation. Currently unsure why this discrepancy exists and could not identify and resolve the issue.

WASM conversion for Argon2 hashing

WASM conversion for Argon2 hashing
@polydeuxes
Copy link
Author

the compiled wasm files currently dont work with the program. will need to adjust.

@moonsettler
Copy link
Owner

CORS policy in modern browsers won't let this run locally, it needs a webserver.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///.../argon-bwg/argon2.wasm. (Reason: CORS request not http)
failed to asynchronously prepare wasm: [object ProgressEvent]

@moonsettler
Copy link
Owner

moonsettler commented Jul 23, 2024

managed to try it out, it runs, but it gives different hashes. looked at the parameters, everything seems fine. correct algo is selected with 2.

one thing that could be different is the serialization of the message and salt?

edit: or maybe there is a step where the argon2 result needs to be 'decoded'? there is such an operation in the js version.

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

Successfully merging this pull request may close these issues.

2 participants