Password lab

This lab provides a superficial investigation into how quickly a computer can crack different types of passwords. The password-cracking method used here is the simplest possible type of attack: the computer just randomly guesses possible passwords until it finds the right one. The lab may be completed in teams of two, so you may collaborate with your team members on the answers to homework questions for this class. To complete the lab, please perform the following steps:
  1. Familiarize yourself with how to execute and edit Python programs.
  2. Download the password lab zip file, and unzip it (by double-clicking it) into a new folder somewhere.
  3. Cracking numeric passwords: We first investigate the cracking of numeric passwords (i.e. passwords that consist only of numeric digits, like "34259"). The program guess-numeric.py accepts one commandline argument specifying the number of digits in your password. For example, the command python guess-numeric.py 6 will ask you to enter a six-digit numeric password. It then tries to guess your password (by randomly selecting six-digit numbers until it finds the right one) and tells you how long it took to do so.
  4. Cracking alphabetic passwords: Next we investigate the cracking of lowercase alphabetic passwords (i.e. passwords that consist only of the lowercase letters a-z, like "fudjfdo"). The program guess-alphabetic.py accepts one commandline argument specifying the number of letters in your password. For example, the command python guess-alphabetic.py 6 will ask you to enter a six-letter lowercase password. It then tries to guess your password (by randomly selecting six-letter strings until it finds the right one) and tells you how long it took to do so.
  5. (Optional) Cracking dictionary word passwords: Next we investigate the cracking of passwords that are words in English (e.g. "dog"). The program guess-word.py requires no commandline arguments. It loads a dictionary of about 250,000 English words, and asks you to enter an English word as your password. It then tries to guess your password (by randomly selecting words from its dictionary until it finds the right one) and tells you how long it took to do so.
  6. (Optional) Cracking word+digit passwords: Next we investigate the cracking of passwords that consist of an English word followed by a single digit (e.g. "tree7"). The program guess-word-and-digit.py requires no commandline arguments. It loads a dictionary of about 250,000 English words, and asks you to enter an English word plus one digit as your password. It then tries to guess your password (by randomly selecting words from its dictionary followed by a random digit, until it finds the right combination) and tells you how long it took to do so.
  7. (Optional) Cracking word+2digits passwords: (This part of the lab is optional. No extra credit is available.) Save the file guess-word-and-digit.py as a new file called guess-word-and-2digits.py. Now edit your new file so that it guesses passwords consisting of a dictionary word plus 2 digits (e.g. "robot73"). Hint: you should only need to change the lines in the file marked with "#####". Once you have made the necessary changes, run the new program and determine approximately how much longer it takes to guess these word+2digits passwords, compared to the word+digit passwords.