Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit implements support for the HIBPv2 Dumps and API.
See https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/
Since the new dumps aren't sorted by SHA anymore using them requires some expensive preprocessing. But since it's a very expensive operation anyway, only intended to be performed very very few users, this should be OK.
As a much easier approach this PR also includes a way to securely check the password hashes against the HIBPv2 API. To avoid leaking sensitive data (SHA1 hashes of secrets) the API supports sending only the first five chars of the hash and returns a list of possible matches which we then check on the client side. Of course this still leaks some entropy to the server, but I can't imagine any feasible attack using only the first five bytes of the hash.