antelle / argon2-browser

Argon2 library compiled for browser runtime
https://antelle.net/argon2-browser
MIT License
367 stars 79 forks source link

Argon2d implementation equivalence #34

Closed afrancht closed 4 years ago

afrancht commented 4 years ago

Hello,

If I make use of argon2d-browser and hash a password in the client-side and then want to verify that hash in the server-side. Can I use a different Argon2d library to do so, like for example: https://github.com/ranisalt/node-argon2, https://github.com/jdconley/argon2themax or https://github.com/cjlarose/argon2-ffi ??

Thank you

antelle commented 4 years ago

Hi! Yes, it's the recommended way of verifying it. Of course it's possible to use argon2-browser on server, but the WebAssembly implementation is less efficient.

afrancht commented 4 years ago

You are quick! I'm impressed!! Thanks!

Also should I store the hash hex or the encoded version?

antelle commented 4 years ago

The encoded version is hash + argon2 parameters, such as version used, parallelism, etc... If you want the library to read the parameters from it, you should store the encoded version; if you would like to provide them yourself, store only hash.