UNIXworkcode

#!/bin/bash saltlen=8 salt="$(cat /dev/urandom | head -c $saltlen)" pwsalt=$1$salt pwhash="$(head -c -1 << EOF | openssl dgst -sha1 -binary $pwsalt EOF )" ssha="$(head -c -1 << EOF | base64 $pwhash$salt EOF )" ssha="{SSHA}$ssha" echo $ssha