Brute-force password cracking

Folder: passwords
Files: passwords/summary.txt, cracked1.txt, cracked2.txt, cracked3.txt, passwords.py

Partner or solo, as you wish.

Goals

Rubric

1 - author name(s) in summary.txt 2 - all passwords cracked for part 1 1 - some passwords cracked for part 2 3 - timing reports 6 - analysis

Part 1: Unsalted one-word passwords

Password files on Unix systems have lines that look something like this:

jondich:182072537ada59e4d6b18034a80302ebae935f66adbdf0f271d3d36309c2d481::0:99999:7:::
This colon-delimited set of fields includes the user name, the SHA-256 hash of the user's password, and then miscellaneous other stuff that won't concern us.

As we'll see, this is not quite a modern format for a variety of reasons, including the fact that the cryptographic hash function has not been explicitly specified and there's no salt included. But this is pretty close to how passwords are stored on most Linux systems.

Consider example password file #1. Your job for Part 1 is to:

A little help

Part 2: Unsalted two-word passwords

Same task as Part 1, but using example password file #2. This time, all the passwords are two random words concatenated (e.g. "cowgecko"). The password for jondich is still "moose".

Part 3: Salted passwords

Now, let's switch to a slightly different password file format:

jondich:$5$e75fa822$8a604057b98aff07885d29eea97e885e::0:99999:7:::

For this phase, use example password file #3.

In the hash field, we have an 8-digit hexadecimal number known as "salt", then a dollar sign, and then the hash of the salt concatenated with the password (i.e. H(salt || pw)). As before, the "jondich" password is "moose", so you can use that to check your hash computation code. Also, as before, the hash function we're using is SHA-256.

(WARNING: This hashing technique is designed to introduce you to the basic idea of salted passwords. However, the technique and salt sizes used here are not ready for prime-time. There are a couple more steps we need to take—longer salts, multiple rounds of hashing, etc.—before we're getting close to best practice for password storage.)

As in parts 1 and 2:

What to hand in?

In your "passwords" folder, put:

A couple clarifications

Have fun!