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

Prehash login passwords on client-side before sending them #4

Open
Zaczero opened this issue May 8, 2024 · 1 comment
Open

Prehash login passwords on client-side before sending them #4

Zaczero opened this issue May 8, 2024 · 1 comment
Assignees
Labels
P2 Standard priority task size S Small development effort required

Comments

@Zaczero
Copy link
Member

Zaczero commented May 8, 2024

This will introduce a new safeguard against potentially compromised server. By having strong client-side hashing step, we could reduce server-side hash complexity and save on resources.

@Zaczero Zaczero added P2 Standard priority task size S Small development effort required labels May 29, 2024
@Zaczero
Copy link
Member Author

Zaczero commented May 31, 2024

@staticmethod
    def client_prehash(password: PasswordStr) -> str:
        """
        Prehash a password using the client's algorithm.
        """
        return pbkdf2_hmac(
            hash_name='sha256',
            password=password.get_secret_value().encode(),
            salt=b'',
            iterations=20_000,
        ).hex()

https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#browser_compatibility
https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/deriveBits#browser_compatibility

@Zaczero Zaczero self-assigned this Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Standard priority task size S Small development effort required
Projects
None yet
Development

No branches or pull requests

1 participant