DOKK Library

Password Generator

Authors Jason Self

License CC0-1.0 GPL-3.0-or-later

Plaintext
jxself.org


Password Generator                                                                         Home

A recent conversation on identi.ca prompted me to share this.                              Linux-libre
Instead of using a password manager to store your passwords, this eliminates the
need to store passwords entirely.                                                          GitWeb

Just make up a salt which you keep to yourself and use each time while combining it        How To
with some other value that's specific to the site/server/email account in question, like
the domain name or email address or whatever.                                              Articles
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.                 RSS Feed

Since the hashed value of your salt and that site-specific thing will always be unique     About Me
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    Contact Me
isn't one. You can also always regenerate your passwords from anywhere using
standard programs.
                                                                                           GPL enforced
#!/bin/bash
echo -n "Enter your salt (won't be displayed): "
read -s SALT                                                                                If you appreciate any of the things I
echo -en "\n"                                                                               am doing you can make a donation.
echo -n "Confirm: "
read -s SALT_CONFIRM
echo -en "\n"
if [ $SALT != $SALT_CONFIRM ]; then
        echo "Confirm did not match. Program ending."
        exit 1;
fi
echo -n "Enter your string: "
read STRING
echo -n "Confirm: "
read STRING_CONFIRM
if [ $STRING != $STRING_CONFIRM ]; then
        echo "Confirm did not match. Program ending."
        exit 1;
fi
echo -n "Your password is: "
PASSWORD=$(echo -n "$SALT$STRING" | sha512sum | base64 -w 0)
echo ${PASSWORD:0:32}
exit 0;
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.