Skip to content

Instantly share code, notes, and snippets.

@ajgappmark
Forked from chaitu87/hash.sh
Created April 17, 2022 14:02
Show Gist options
  • Save ajgappmark/11161d8dfb955b73f0936756ec626ec9 to your computer and use it in GitHub Desktop.
Save ajgappmark/11161d8dfb955b73f0936756ec626ec9 to your computer and use it in GitHub Desktop.
Hashpass shell script with xclip to copy password to clipboard
#!/bin/bash
#hashapass.com method for generating passwords
#script by Simon Elmir
export IFS="" #read will now preserve whitespace
read -rp "parameter: " PARAMETER
read -rsp "password: " PASSWORD
echo
echo -n "$PARAMETER" \
| openssl dgst -sha1 -binary -hmac "$PASSWORD" \
| openssl enc -base64 \
| cut -c 1-28 \
| xclip -selection c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment