Last active
May 29, 2018 16:01
-
-
Save Serpens/116ed1586ade90d51d9305a7cb77772a 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 sys | |
import requests | |
from hashlib import sha1 | |
checked_hash = sha1(sys.argv[1].encode()).hexdigest().upper() | |
prefix, suffix = checked_hash[:5], checked_hash[5:] | |
r = requests.get('https://api.pwnedpasswords.com/range/' + prefix) | |
if r.text.find(suffix) == -1: | |
print('strong password') | |
else: | |
print('weak password') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment