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

fix: add support for migration of scrypt passwords #1768

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

J0
Copy link
Contributor

@J0 J0 commented Sep 6, 2024

What kind of change does this PR introduce?

Fix #1750. Scrypt passwords are widely used in certain systems like Firebase. We wish to allow support for use of Scrypt hashes so that developers can move over from Firebase (or similar) without the obligation to force a password reset for all users.

Firebase Scrypt differs from vanilla Scrypt - we highlight these changes in the comments

Hash format is:

$scrypt$n=<N>,r=<r>,p=<p>[,ss=<salt_separator>][,sk=<signer_key>]$<salt>$<hash>
$scrypt: Version Identifier
$n: N is the CPU/memory cost parameter.
$r: block size
$p: parallelization
$ss: salt seperator, optional, only if using firebase,  base64-encoded string used to separate the salt from other parameters.
$sk: signer key, a base64-encoded string used as an additional input to the hash function.
$<salt>: base64 encoded salt
$<hash>: base64 encoded output

Parameters used in the hash config
More details from CLI

return nil, fmt.Errorf("crypto: scrypt hash uses unsupported algorithm %q only scrypt supported", alg)
}
if v != "1" {
return nil, fmt.Errorf("crypto: scrypt hash uses unsupported version $q only version 1 is supported", v)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, fmt.Errorf("crypto: scrypt hash uses unsupported version $q only version 1 is supported", v)
return nil, fmt.Errorf("crypto: scrypt hash uses unsupported version %q only version 1 is supported", v)

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