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

Expose secret / peper #15

Open
tobiasdiez opened this issue Oct 3, 2024 · 0 comments
Open

Expose secret / peper #15

tobiasdiez opened this issue Oct 3, 2024 · 0 comments

Comments

@tobiasdiez
Copy link

Package version

latest

Describe the bug

Argon supports a secret key: https://github.com/P-H-C/phc-winner-argon2?tab=readme-ov-file#library

The secret parameter, which is used for keyed hashing. This allows a secret key to be input at hashing time (from some external location) and be folded into the value of the hash. This means that even if your salts and hashes are compromised, an attacker cannot brute-force to find the password without the key.

If I see this correctly then the argon2 npm package supports this (https://github.com/ranisalt/node-argon2/blob/7bf76721387db96f3ae153577dd370e08405ebe5/argon2.cjs#L57C1-L57C31) but it's not yet supported by the hash/verify methods of this package:

hash/src/drivers/argon.ts

Lines 207 to 216 in 9463702

const hash = await driver.hash(value, {
salt,
version: this.#config.version,
type: this.#variants[this.#config.variant],
timeCost: this.#config.iterations,
memoryCost: this.#config.memory,
parallelism: this.#config.parallelism,
hashLength: this.#config.hashLength,
raw: true,
})

Reproduction repo

No response

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

No branches or pull requests

1 participant