BYU logo Computer Science
CS 465 Introduction to Security and Privacy

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:

using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello Again!");
}
}

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:

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