Created
May 3, 2018 17:27
-
-
Save rvalieris/f6a2ca6786c19e7786a94e5878f68416 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