Created
August 10, 2020 10:40
-
-
Save pfgithub/a099442f6d3cf3613f4b05de9aae609b to your computer and use it in GitHub Desktop.
check if a password has been pwned on haveibeenpwned
This file contains hidden or 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 fish | |
| set password (read -s) | |
| set sha1hash (echo -n $password | sha1sum) | |
| set firstfiv (string sub -s 1 -l 5 $sha1hash) | |
| set lastpart (string sub -s 6 -l 35 $sha1hash) | |
| curl -s https://api.pwnedpasswords.com/range/$firstfiv | grep -i "^"$lastpart":" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment