Password Generator

A recent conversation on identi.ca prompted me to share this.

Instead of using a password manager to store your passwords, this eliminates the need to store passwords entirely.

Just make up a salt which you keep to yourself and use each time while combining it with some other value that's specific to the site/server/email account in question, like the domain name or email address or whatever.

In this version your salt and site-specific thing are concatenated together, hashed, and then base64-encoded. The first 32 characters are returned as the password.

Since the hashed value of your salt and that site-specific thing will always be unique you get a different password for each place. You also need never fear the loss or corruption of your password database, have to deal with backing it up, etc. since there isn't one. You can also always regenerate your passwords from anywhere using standard programs.

echo -n "Enter your salt (won't be displayed): "
read -s SALT
echo -en "\n"
echo -n "Confirm: "
echo -en "\n"
if [ $SALT != $SALT_CONFIRM ]; then
        echo "Confirm did not match. Program ending."
        exit 1;
echo -n "Enter your string: "
echo -n "Confirm: "
if [ $STRING != $STRING_CONFIRM ]; then
        echo "Confirm did not match. Program ending."
        exit 1;
echo -n "Your password is: "
PASSWORD=$(echo -n "$SALT$STRING" | sha512sum | base64 -w 0)
echo ${PASSWORD:0:32}
exit 0;




How To


RSS Feed

About Me

Contact Me

This project enforces the 

If you appreciate any of the things I am doing you can make a donation.

To the extent possible under law, I waive all copyright and related or neighboring rights to this script. For more information see http://creativecommons.org/publicdomain/zero/1.0/. This work is published from the United States. For the rest see license.shtml for license conditions. Please copy and share.