Secure Password Generator
A long time ago a friend of mine gave me the great idea on how to secure my passwords with MD5 sums.
The trick is to take a phrase you can easily remember and then hash that phrase using the hashed value as your password
So I started on my Linux box, with a simple command that hashed my text string:
echo -n password |md5sum
And the computer returns this:
5f4dcc3b5aa765d61d8327deb882cf99 -
So usually I will just log into a dummy account with putty and run that command to get my root password, then su into the root account.
Here is a way to do it with a shell scipt:
echo "Enter String to Hash"
read password
password=$(echo -n $password|md5sum| cut -c 1-32)
echo Your New Password is:"$password"
The above script is good if you have trouble remembering commands, just copy that code into your text editor on Linux, save it and make it executable.
I was sitting around one day thinking of a way I could add an extra layer of security to this whole process. My idea was to loop the hashes so that I was hashing the hash values of my original text string.
Theory Explained:
I will use "password" as my string
password
hashed= 5f4dcc3b5aa765d61d8327deb882cf99
5f4dcc3b5aa765d61d8327deb882cf99
hashed= 696d29e0940a4957748fe3fc9efd22a3
So I could write a script that prompted for a number of times the value went through the hashing code, and also for the text string to start with originally.
And Here it is:
echo "Enter String to Hash"
read password
echo "Number of Times to Hash"
read number
number=$(($number+1))
count=1
until [ $count = $number ]
do
password=$(echo -n $password|md5sum| cut -c 1-32)
count=$(($count+1))
done
echo Your New Password is:"$password"
There you have it. You can use this script to lock down your root account and su to get into it. I recommend using an interface that allows you to cut and paste.
Also don't use the looping script for your user account that initiates the login to the machine or you will have to find a way to loop the hash values.
I also created a windows version of this program to secure your all your other passwords.
Just run the sum.bat script to operate the program.
The trick is to take a phrase you can easily remember and then hash that phrase using the hashed value as your password
So I started on my Linux box, with a simple command that hashed my text string:
echo -n password |md5sum
And the computer returns this:
5f4dcc3b5aa765d61d8327deb882cf99 -
So usually I will just log into a dummy account with putty and run that command to get my root password, then su into the root account.
Here is a way to do it with a shell scipt:
echo "Enter String to Hash"
read password
password=$(echo -n $password|md5sum| cut -c 1-32)
echo Your New Password is:"$password"
The above script is good if you have trouble remembering commands, just copy that code into your text editor on Linux, save it and make it executable.
I was sitting around one day thinking of a way I could add an extra layer of security to this whole process. My idea was to loop the hashes so that I was hashing the hash values of my original text string.
Theory Explained:
I will use "password" as my string
password
hashed= 5f4dcc3b5aa765d61d8327deb882cf99
5f4dcc3b5aa765d61d8327deb882cf99
hashed= 696d29e0940a4957748fe3fc9efd22a3
So I could write a script that prompted for a number of times the value went through the hashing code, and also for the text string to start with originally.
And Here it is:
echo "Enter String to Hash"
read password
echo "Number of Times to Hash"
read number
number=$(($number+1))
count=1
until [ $count = $number ]
do
password=$(echo -n $password|md5sum| cut -c 1-32)
count=$(($count+1))
done
echo Your New Password is:"$password"
There you have it. You can use this script to lock down your root account and su to get into it. I recommend using an interface that allows you to cut and paste.
Also don't use the looping script for your user account that initiates the login to the machine or you will have to find a way to loop the hash values.
I also created a windows version of this program to secure your all your other passwords.
Just run the sum.bat script to operate the program.
hasheesh.zip | |
File Size: | 24 kb |
File Type: | zip |
Sometimes I find myself needing to md5 my string to log on remotely and I do not have my scripts with me. Just use an online MD5 Generator.
http://www.md5.cz/
is just one of many.
http://www.md5.cz/
is just one of many.