Skip to content

Instantly share code, notes, and snippets.

@bzed
Created January 18, 2019 10:50
Show Gist options
  • Save bzed/c35cc51222cef9febfd391a5cca07ac2 to your computer and use it in GitHub Desktop.
Save bzed/c35cc51222cef9febfd391a5cca07ac2 to your computer and use it in GitHub Desktop.
haveibeenpwned password check
#!/bin/bash
echo -n "Enter Password: "
read p
sha=`echo -n "${p}" | sha1sum - | awk '{print $1}'`
sha_short=`echo -n "${sha}" | sed 's,^\(.....\).*,\1,'`
wget -q -O - "https://api.pwnedpasswords.com/range/${sha_short}" | grep -i "${sha}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment