How can I make this password search more inteligent?

In a homework, there is exercice when I have a script that is used to search a password.

One of the questions is if is possible to make it "more inteligent", and I'm stuck on it.

The script:

#!/bin/bash

space1="a b c d e f g h i j k l m n o p q r s t u v w x y z"

if [  $# -le 1 ] then echo "Ussage: "$0 SALT PASSWORD_CODED
exit
fi

for i in $space1 do for j in$space1
do
for k in $space1 do variable=$(openssl passwd -crypt -salt "$1" "$i$j$k")
if [ "$variable" =$2 ]
then
echo password found: $i$j$k exit fi done done done  DISCLAIMER: This is homework. If is possible I prefer only a clue to help me to discover the answer correct. Not the answer itself. I promise to put the result when I get the answer for myself. - +1 for request only for clue – Sunny Oct 7 '11 at 16:17 As suggested, you could use common words first or a dictionary, but brute force is brute force. In this case it's only 3 lower case characters, so it should take no time at all. I don't know if there is any other way to make the algorithm more intelligent. – Matt Oct 9 '11 at 8:16 What does "more intelligent" mean? – palacsint Nov 6 '11 at 21:57 add comment 4 Answers There's no real way to speed up the brute-force enumeration of all possible 3-letter passwords. Perhaps you could use the dictionary. There's a finite list of 3-letter English words. They may be slightly more common. Also, if you google for "most common passwords", some kind of 3-letter version of that list could be tried before anything else. - add comment Look at the man page for openssl http://www.openssl.org/docs/apps/openssl.html It is the command being executed here: $(openssl passwd -crypt -salt "$1" "$i$j$k")


Another Clue below.
Only roll your curser over it if you need the extra help.

Do you need to pass the passwords one at a time.

Still have not worked it out!

-

The best way to do

space1="a b c d e f g h i j k l m n o p q r s t u v w x y z"
for i in $space1; do for j in$space1; do
for k in $space1; do echo$i$j$k
done
done
done


in bash is probably :

for i in {a..z}{a..z}{a..z}; do echo \$i; done


Then, depending on what your homeworks says, it might or might not be what you are looking for.

-