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

Add support for scrypt #4

Open
PhilippMDoerner opened this issue Sep 5, 2023 · 0 comments
Open

Add support for scrypt #4

PhilippMDoerner opened this issue Sep 5, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@PhilippMDoerner
Copy link
Owner

So far only pbkdf2 and argon are supported.

A new module under src/nimword could be added to provide a module with the following procs:

proc hashEncodePassword*(password: string, iterations: int, <whatever optional additional parameters>): string
proc isValidPassword*(password: string, encodedHash: string): bool

proc hashPassword*( <whatever parameters>): string
proc encodeHash*( <whatever parameters>): string

Where:

  1. hashPassword is the core hashing proc that hashes a password with scrypt and has whatever parameters it needs
  2. encodeHash is a way to encode the output of scrypt into a string that can be stored in a db and be used with isValidPassword
  3. hashEncodePassword a way to call 1) and 2) together for convenience
  4. isValidPassword to be able to validate whether a given clear-text password when hashed equal the hash included somewhere within the output of encodeHash

That module should also touch nimword.nim in order to include scrypt into the overarching hashEncodePassword and isValidPassword procs there.

@PhilippMDoerner PhilippMDoerner added enhancement New feature or request good first issue Good for newcomers labels Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant