Password Cracking
Objectives
This is a practice project to help you learn C#. Your goal is to make a very simple password cracking program. While you may think of password cracking as something that an attacker does, this is actually a useful thing for a legitimate website to do — if your user’s passwords are easily cracked, then maybe an attacker will be able to get in easily!
Project Setup
Follow the instructions in this short tutorial. You should:
- Install Visual Studio Code if you haven’t already.
- Install the
C# Dev Kit
extension. - Create the Hello World app.
After you have done this, convert the Hello World app to be object-oriented:
Practice both running and debugging the code.
Project
Now write a simple password cracker. This program should:
- Load a file containing words in the dictionary
- Prompt the user for their password
- Check the password against every password in the dictionary, and print the password if it is found.
- Print “Not Found” if not found.
Be sure to create a new project for this, instead of re-using the hello world projet.
To write this code, you may find the following resources helpful:
-
[A dictionary of American English words](http://wordlist.aspell.net/12dicts/](http://wordlist.aspell.net/12dicts/). You can use the file in
American/2of12.txt
. -
Since hashing uses a byte array, convert a string into an array of bytes.
If you would like to go farther, you may also want to try checking for common substitutions that people use to disguise their password, such as:
- a -> @
- l -> 1
- e -> 3