-
-
Save adefelicibus/91c34895b627dbbe13d5708cc3dd6c56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import requests | |
import hashlib | |
import getpass | |
password = getpass.getpass() | |
hash = hashlib.sha1(password.encode("utf8")).hexdigest().upper() | |
head, rest = hash[:5], hash[5:] | |
r = requests.get("https://api.pwnedpasswords.com/range/%s" % head) | |
if rest in r.content.decode("utf8"): | |
print("Password breached.") | |
else: | |
print("You're good... For now.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment