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

Passwords are hashed using SHA256 #258

Closed
SteveSyfuhs opened this issue Apr 7, 2024 · 3 comments
Closed

Passwords are hashed using SHA256 #258

SteveSyfuhs opened this issue Apr 7, 2024 · 3 comments
Labels

Comments

@SteveSyfuhs
Copy link
Member

Is this a function of the Redis protocol or is this an internal implementation detail?

public static ACLPassword ACLPasswordFromString(string password)
{
byte[] hash = SHA256.HashData(Encoding.UTF8.GetBytes(password));
return new ACLPassword(hash);
}

If this is an implementation detail then this needs to be converted into something more time consuming using a KDF plus salt.

@eveloki
Copy link

eveloki commented Apr 8, 2024

Redis internally stores passwords hashed with SHA256.

https://redis.io/docs/management/security/acl/

@lmaas
Copy link
Contributor

lmaas commented Apr 8, 2024

We chose to use plain SHA-256 hashes to ensure compatibility with Redis’s ACL rules. However, we are actively exploring improvements, such as introducing an optional syntax for salted hashes and potentially transitioning to a more compute-intensive KDF. While addressing this isn’t our top priority at the moment, we are aware of this issue and will address it in the future.

@SteveSyfuhs
Copy link
Member Author

Makes sense. I also see you're adding in AAD support as well, which is probably the better long-term approach anyway. If and when you get to improving the hashing feel free to reach out to me internally (stsyfuhs@ms) if you're inclined. My team owns Windows auth so we have an abundance of lessons learned around protocol auth.

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

No branches or pull requests

5 participants