How does GitHub know I have a weak password?

蹲街弑〆低调 提交于 2020-06-16 08:32:31

问题


I have received this message today when I tried to push my code:

remote: Weak credentials. Please Update your password to continue using GitHub.
remote: See https://help.github.com/articles/creating-a-strong-password/.

How do they know I used a weak password since they only store the password hash?


回答1:


Yes, your understanding is correct. When you type a password to sign in, create an account, or change your password, GitHub will check if the password you entered is considered weak according to datasets like HaveIBeenPwned. The password may be identified as weak even if you have never used that password before.

GitHub only inspects the password at the time you type it, and never stores the password you entered in plaintext.

Below can be possible implementation:

  1. User login using valid credentials.

  2. Checks if the password is secure before hashing it: Checks the password SHA-1 hash against the Passwords API of https://haveibeenpwned.com/.

  3. If the password is insecure, it can store a binary toggle as a user field.

  4. If the user has that binary toggle set, show a warning on EVERY page and nudge them towards changing the password



来源:https://stackoverflow.com/questions/59425506/how-does-github-know-i-have-a-weak-password

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!