Skip to content

Instantly share code, notes, and snippets.

@chaitu87
Created July 2, 2012 06:52
Show Gist options
  • Save chaitu87/3031534 to your computer and use it in GitHub Desktop.
Save chaitu87/3031534 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