Another day, another password hack and yet another reason not to reuse passwords...
Here is a simple bash script to generate strong passwords.
1) Install TrueCrypt http://www.truecrypt.org/
2) Create a hidden volume. Pick a strong passphrase you will not write down and use a keyfile
3) Mount the volume
4) Run the Script
I'll port it to Python this weekend, or maybe even something more platform independent. Also, don't forget to set Auto Dismount to 15 minutes, so you don't leave it up and running.
[code]
#!/bin/bash
#
#
# For Resiliency I keep the volume in multiple places, but for ease of use
# of use, I suggest keeping it on Dropbox. Set TrueCrypt to unmount after
# 30 minutes of idle.
echo "Hello, "$USER". This will generate your password. Please make sure you have mounted your TrueCrypt volume with your password file"
echo -n "Please enter the path to your encrypted vault file [ENTER]: "
read vaultfile
echo -n "Please enter the patch to your encrypted mount, this will be used for temp files [ENTER]: "
read encmounts
echo -n "Enter the website or application that this password is for and press [ENTER]: "
read site
grep -i $site $vaultfile
if [ $? == 0 ]; then
echo -n "Do you want to create a new password for this existing account? (yes or no): "
read update
if [ "$update" == "yes" ]; then
echo -n "Enter the user ID you will be using and press [ENTER]: "
read name
echo -n "Enter maximum password length characters can the password be [ENTER]: "
read counts
sed "/$site/d" $vaultfile > $encmounts/tmp ; mv $encmounts/tmp $vaultfile
curl -s http://www.bing.com/news?q=$color > $encmounts/temp
newpass=`md5 $encmounts/temp | awk '{print $4}' | openssl sha | cut -c 1-$counts|sed -e 's/[a-z]/A/' -e 's/[0-9]/#/'`
echo $name $newpass $site >> $vaultfile
# rm $encmounts/tmp
exit 1
elif [ "$update" == "no" ]; then
echo "Goodbye"
fi
fi
echo -n "Enter the user ID you will be using and press [ENTER]: "
read name
echo -n "Enter maximum password length characters can the password be [ENTER]: "
read counts
curl -s http://www.bing.com/news?q=$color > $encmounts/tmp
newpass=`md5 $encmounts/tmp | awk '{print $4}' | openssl sha | cut -c 1-$counts |sed -e 's/[a-z]/A/' -e 's/[0-9]/#/'`
echo $name $newpass $site >> $vaultfile
rm $encmounts/tmp
echo "Goodbye"
[/code]




