ZAMYLA CHAN: Let's get cracking once again.
In this problem, we're going to re-implement the crack problem that we
solved in C, this time in Python.
All of the logic remains the same.
We're going to get the hashed password from the user passed
in as a command-line argument.
In Python, you can access the list of command-line arguments
in the variable sys.argv.
Second, we're going to crack these passwords.
Yet again, we're allowed to make the assumption that all of these passwords
are hashed the exact same way, using the crypt module.
So import that and you'll be able to access
the crypt function, which takes in two arguments--
word and salt. Remember that hashing a word will always return the same hash.
So calling crypt on the same work and the same salt over and over again
will always return the same value.
Yet again, you can still assume that these passwords
are no longer than four characters and composed entirely
of alphabetical characters.
So let's generate the inputs to be hashed.
For these guesses, try to think of a way to carefully iterate over
every combination of one to four characters, where those characters are
all alphabetic and case-sensitive.
Perhaps you might use a string, or several strings of length 1,
2, 3, and 4, iteratively updating one character
in the string from A to B to C and so on, and indexing into that string.
That's it for now.
Let's see if you can crack it.
My name is Zamyla, and this was Crack.