Behold, the mighty Mickeysoft NT hash: printf '%s' "$pw" | iconv -f UTF-8 -t UTF-16LE | openssl dgst -md4 -provider legacy -binary | base64 Don't ever use NT hashing if you can avoid. Not always avoidable, sadly.