Skip to content

Shane-Donlon/pp3-hacked-game

Repository files navigation

Hacked Game

Hacked Game is a Python Terminal Application that is intended to educate people on the importance of strong passwords It is comprised of

  • A password strength checking tool
  • An option to check if the users password is on the most hacked password list of 2022 Source
  • A password guessing game that uses the list of most hacked passwords in 2022
  • An option to create strong passwords (and check the password strength simultaneously)

Site Preview on desktop laptop tablet and mobile

User Stories

  • As a user I want a site where I can check the strength of my password
  • As a user I want a site where I can verify my password against common passwords
  • As a user I want to play a game to educate me on using weak passwords
  • As a user I want to play a game to educate me on common passwords
  • As a user I want to be able to create strong passwords and verify the strength of the new password generated

How to use & Features:

  1. Go to https://pp3-hacked-game-932b8166abb0.herokuapp.com/
  2. Wait for application to load

Password Strength Checker:

  1. From the main menu enter option "1" and press Enter
  2. Type out your password (this field does not display the password typed) and press Enter
    • The application will then output "At a rate of 100 guesses per hour your password would take {time} to crack"
    • Passwords will then be deleted from memory
  3. Press Enter to return to the main menu

Is your password on the Hacked Password List?

  1. From the main menu enter option "2" and press Enter

  2. Type out your password (this field does not display the password typed) and press Enter

    • The application will then output either

      • The password entered is on the list

      • With additional feedback to change password

        Site feedback for password on list

    • The password entered is not on the list

      Site feedback for password not on list

  3. Press Enter to return to the main menu

Password Hacking Game:

  1. From the main menu enter option "3" and press Enter

    • The menu will display 5 options
    • The game modes
    • View Leader Board
    • Exit to main menu
  2. Enter the difficulty you wish the try:

    • "Easy"
    • "Difficult"
    • "Hard"
  3. The game instructions will then print

  4. Press Enter to continue to the game

  5. The game will tell you the length of the password

  6. Input your guess into the game and await feedback

  7. Yellow feedback indicates that the characters are in the password but in the wrong location

    Site feedback for correct character wrong location

  8. White feedback indicates that the characters are not in the password

    Site feedback for character not in password

  9. Green feedback (u in the bellow screenshot) indicates that the characters are in the password and the correct location

    Site feedback for correct character correct location

  10. If you guessed all the characters in the correct location you will win the game

    Site feedback for winning the game

  11. Enter your name to add your name to the leader-board, or select q to exit

  12. If you get stuck you can enter help as an option to reveal the password character types

    Site feedback for help function

Password Hacking Game Leader-board

  1. From the main menu enter option "3" and press Enter

    • The menu will display 5 options
    • The game modes
    • View Leader Board
    • Exit to main menu
  2. Input 4 and press enter

  3. You will then need to decide on the difficulty leader board to view

    Site feedback for leader board options

  4. The desired leader board table will print (sorted lowest guesses to highest)

    Leader board printed in terminal

Password Generator

  1. From the main menu enter option "4" and press Enter
  2. Enter the length of the password greater than 1
    • 0 length passwords
    • Negative integer passwords
    • 1 length passwords will display an error
  3. Copy the password from terminal
  4. Press Enter to return to the main menu

Example Output:

Password Generator output from terminal

Technologies used:

Languages:

  • Python The main language used in the terminal application
  • JavaScript Used in the template to run the terminal
  • HTML used in the template to present the terminal

Libraries and packages used:

Other Tools:

  • GitHub: Used to host the application source code.
  • VSCode Visual Studio Code: used to edit the application source code.
  • Heroku: Used to host the application
  • LucidChart Used for diagrams

Workflows

Main menu

Main Menu Workflow

Password Strength Checker

Password Strength Workflow

Password On List

Password on password list Workflow

Main Game

main Game Workflow

Leaderboard

Leader Board Workflow

Password Generator

Password Generator Workflow

Testing

Automated Testing

No errors found

  • run.py module

Python Linter Results for run.py file

  • password_on_list.py module

Python Linter Results for password_on_list.py file

  • password_checker_zxcvbn.py module

Python Linter Results for password_on_password_checker_zxcvbn.py file

  • password_global_vars.py module Python Linter Results for password_on_password_global_vars.py file

  • generating_password.py module Python Linter Results for password_on_generating_password.py  file

  • game.py module Python Linter Results for password_on_generating_password.py  file

Manual Testing

Command Prompt was used to run the application locally, and updates were tested again after deployment to Heroku

Testing Description Expected Action Actual Output Result
Main Menu Loads User is presented with menu User is presented with menu Confirmed
Main Menu Option 1 User is presented with password strength checking tool User is presented with password strength checking tool Confirmed
Main Menu Option 2 User is presented with checking password against password list User is presented with checking password against password list Confirmed
Main Menu Option 3 User is presented with a game User is presented with a game Confirmed
Main Menu Option 4 User can create a new password User can create a new password Confirmed
Main Menu Option Q Application ends Application ends Confirmed
All other input Presents error and presents menu Presents error and presents menu Confirmed
Password Strength User inputs a correct password to verify Password is verified with time to crack Confirmed
Password Strength User inputs a 0 length password User is presented with error and asked to enter a correct password Confirmed
Password List User inputs a correct on the list User is informed password is on the list Confirmed
Password List User inputs a password not on the list User is informed password is not on the list Confirmed
Password List User inputs a 0 length password User is presented with error and asked to enter a correct password Confirmed
Password Game User is presented with Difficulty menu User is presented with Difficulty menu Confirmed
Password Game user inputs easy Easy mode loads Confirmed
Password Game user inputs difficult Difficult mode loads Confirmed
Password Game user inputs hard Hard mode loads Confirmed
Password Game user inputs 4 user is presented with leader board options Confirmed
Password Game Menu User inputs invalid option User presented with error and menu options Confirmed
Password Game leader board user inputs 1 Easy Leader board is presented Confirmed
Password Game leader board user inputs 2 Difficult Leader board is presented Confirmed
Password Game leader board user inputs 3 Hard Leader board is presented Confirmed
Password Game leader board user inputs q User exists current menu Confirmed
Password Game Easy User is presented with game instructions User is presented with game instructions Confirmed
Password Game Difficult User is presented with game instructions User is presented with game instructions Confirmed
Password Game Hard User is presented with game instructions User is presented with game instructions Confirmed
Password Game Easy User inputs guess q Game ends Confirmed
Password Game Difficult User inputs guess q Game ends Confirmed
Password Game Hard User inputs guess q Game ends Confirmed
Password Game Easy User inputs guess help User is presented with help options (as above) Confirmed
Password Game Difficult User inputs guess help User is presented with help options (as above) Confirmed
Password Game Hard User inputs guess help User is presented with help options (as above) Confirmed
Password Game Easy User inputs a guess too short Error to inform user of this appears Confirmed
Password Game Easy User inputs a guess too long Error to inform user of this appears Confirmed
Password Game Easy Guess is the correct length with incorrect characters Printed guess characters in default white Confirmed
Password Game Easy Guess is the correct length with correct letters in wrong place Printed guess characters in yellow Confirmed
Password Game Easy Guess is the correct length with correct letters in correct place Printed guess characters in green Confirmed
Password Game Difficult User inputs a guess too short Error to inform user of this appears Confirmed
Password Game Difficult User inputs a guess too long Error to inform user of this appears Confirmed
Password Game Difficult Guess is the correct length with incorrect characters Printed guess characters in default white Confirmed
Password Game Difficult Guess is the correct length with correct letters in wrong place Printed guess characters in yellow Confirmed
Password Game Difficult Guess is the correct length with correct letters in correct place Printed guess characters in green Confirmed
Password Game Hard User inputs a guess too short Error to inform user of this appears Confirmed
Password Game Hard User inputs a guess too long Error to inform user of this appears Confirmed
Password Game Hard Guess is the correct length with incorrect characters Printed guess characters in default white Confirmed
Password Game Hard Guess is the correct length with correct letters in wrong place Printed guess characters in yellow Confirmed
Password Game Hard Guess is the correct length with correct letters in correct place Printed guess characters in green Confirmed
Password Game User wins Easy User has guessed the correct word Whole word appears in green Confirmed
Password Game User wins Difficult User has guessed the correct word Whole word appears in green Confirmed
Password Game User wins Hard User has guessed the correct word Whole word appears in green Confirmed
Password Game User Wins Easy User is asked to enter name User is asked to enter name Confirmed
Password Game User Wins Easy User enters a 0 length name Error message is displayed and asked for a name Confirmed
Password Game User Wins Easy User enters q as name User returns to menu skipping leader board Confirmed
Password Game User Wins Easy User enters a legitimate name not already on list leader board is updated Confirmed
Password Game User Wins Easy User enters a legitimate name already on list error stating name is already on list appears and asked for a new name Confirmed
Password Game User Wins Difficult User is asked to enter name User is asked to enter name Confirmed
Password Game User Wins Difficult User enters a 0 length name Error message is displayed and asked for a name Confirmed
Password Game User Wins Difficult User enters q as name User returns to menu skipping leader board Confirmed
Password Game User Wins Difficult User enters a legitimate name not already on list leader board is updated Confirmed
Password Game User Wins Difficult User enters a legitimate name already on list error stating name is already on list appears and asked for a new name Confirmed
Password Game User Wins Hard User is asked to enter name User is asked to enter name Confirmed
Password Game User Wins Hard User enters q as name User returns to menu skipping leader board Confirmed
Password Game User Wins Hard User enters a legitimate name not already on list leader board is updated Confirmed
Password Game User Wins Hard User enters a 0 length name Error message is displayed and asked for a name Confirmed
Password Game User Wins Hard User enters a legitimate name already on list error stating name is already on list appears and asked for a new name Confirmed
Password Generator User enters a positive integer between 2 and 40 User is presented with password and password strength Confirmed
Password Generator User enters negative integer User is presented with error and instructions Confirmed
Password Generator User enters any number above 40 User is presented with error and instructions Confirmed
Password Generator User enters a 0 or 1 length password User is presented with error and instructions Confirmed
Google Sheets data reads Password List reads from Google Sheets Password options are in the game Confirmed
Google Sheets data writes Leader board stats updates Leader board stats updates Confirmed

Credits:

Notes:

  • Commit messages: usually feat add style add etc.. is added as a preface to the commit messages, but since it is only python style add etc.. did not make sense to preface every commit with "Pyhon" for an entirely python project.
  • Wildcard imports as the functions are bespoke built by me I used a wildcard import "*" to import the modules, if this wasn't the case I would import selected modules only / functions only

Deployment:

This application is deployed on Heroku using the below instructions

  1. Login to heroku

  2. Create a new app

    Create new app Heroku

3.Complete App Name form

Heroku App Name form

  1. Deploy using github

    Heroku Github connected

  2. Connected to main brach (this was connected to a testing branch for testing purposes)

    Heroku connected to Github main Branch

  3. Added CREDS to the Config Vars (the value is hidden intentionally)

    creds config vars Heroku

  4. Set port to 8000 as required for the terminal to run correctly

    Port config vars heroku

  5. Enable automatic deployments from Branch Main

  6. Deploy Manually

Bugs

Unfixed

  • When resizing the terminal screen the text vanishes from the terminal, this is from the Template used and is not due to my code

No other bugs noted during testing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published