Giter VIP home page Giter VIP logo

password-cracker's Introduction

password-cracker

In this project I will create a program that enables a user to test the strength of the given password or multiple passwords. The program repeatedly generates guesses that aim to match the password(s) the user has given in a .txt file. After completion the program writes execution times and number of guesses it took to guess the given password(s). This project uses python 3.

Documentation

Installation

Requires Python 3

Create a virtual environment

$ python3 -m venv venv

Activate the virtual environment

source venv/bin/activate

Clone the repo

git clone https://github.com/Aleksipa/password-cracker.git

Configurations

Configurations can be found under configs folder. Name of the input file, lenght of ngrams (currently set to 3), accepted characters and number of guesses the program generates from the input file can be configured in config.json file.

Input data and results

Input data files (currently configured to passwords.txt and training.txt) must be in the input folder in .txt format and must contain passwords that are written on separate lines. Training results and password guessing result files are created automatically after the scripts has been executed.

Required input files:

input/passwords.txt

input/training.txt

Available Scripts

This program consists of three separeate program modules: train, markovChain and bruteForce. train generates training result file, that consists of password guesses. Guesses are based on n-gram probabilities of user given training file. Based on the result file markovChain tries each generated guess against user given password(s). bruteForce generates every possible guess and tries the guesses against user given password(s).

In order to guess the password(s) using brute force algorithm run the following:

python3 bruteForce.py

To create passwords based on markov's chain run the following:

python3 train.py

In order to test whether the password guesses generated by markov chain match the password(s) in the input folder, run the following:

python3 markovChain

password-cracker's People

Contributors

aleksipa avatar

Watchers

James Cloos avatar  avatar

password-cracker's Issues

Peer Review

Conducted: 29.8.2020

What I did

  • Set up the environment and downloaded the project
  • Ran the program locally
  • Ran the project's unit tests
  • Read through the documentation
  • Downloaded the project source code and went through it

General Feedback

  • The project's purpose is clear and well communicated
  • It's a shame that I could not get it to work. It would have been fun to try out.
  • The focus of improvement in my opinion should be on the documentation and making it easier to use
  • A suggestion would be to include a UI where the user can feed the files directly

Issues

  • I was unable to get the program to work - it would freeze after running it.
  • I took steps to reproduce the error by altering inputs in both the password and training files, but this was to no avail.
  • Both tests failed. I got: ModuleNotFoundError: No module named 'bforce' and ModuleNotFoundError: No module named 'markov'. These modules seem to be imported in the file, but I don't know enough about python unit tests to tell what's up
  • If there is a specific way to run the test, or some commands that should be run, then these should be well documented

Code Quality

  • The code is somewhat easy to follow due to the limited scope of the project and the fact that Python is generally very readable.
  • Variables are descriptively named
  • Test names could more descriptive, e.g. what does 'test_markov_build_equals' mean?
  • The tests could be more comprehensive in what they test , e.g. how the program/algo responds to unexpected input.
  • The structure is good - modules are in their folders
  • Exceptions handling could be improved - the program simply freezes and the user is left guessing why. From the looks of it, the program should, for instance, inform the user when the training file is empty. I left mine empty and it did not exception out.
  • Since the program run time increases exponentially with larger inputs, the user should be warned/informed of this during runtime

Documentation

External

  • Most of the required documentation was included in the project - needs more work though
  • There should probably be links to the specific documentation files in the README, especially the user guide
  • The user instructions/guide could be clearer - it would be a good idea to communicate all the steps needed to use your program, e.g. how to run the entry file (run.py).
  • How a user inputs data into the program could also be clearer - what are the files called? What form should the input data be in? This information can be found from the config files, but it'd be better for it to be more obvious.

Repository

  • There are helpful comments that accompany most of the methods
  • There could definitely be more comments that are focused on why things are being done the way they are. An example is the markov method - difficult to follow what's going on

Vertaisarvio

Ladattu klo 18.29 19.8.2020

  • Tiedoston run.py funktiossa run yhtä avattua tiedostoa ei suljeta, jos prosessointi keskeytyy poikkeuksen takia. Tiedoston avaamisessa voisi käyttää with-rakennetta kuten samassa funktiossa on tehty toista tiedostoa avattaessa.
  • Jos syötetiedostossa on salasana, jossa on merkki, jota ei ole listattu mahdollisiin merkkeihin konfiguraatiotiedostossa, ohjelma jäätyy ja lopulta kaatuu. Se heittää poikkeuksen Error: cannot unpack non-iterable NoneType object. Koodin tarkastelun perusteella Luokan bruteForce metodi guess ei tällöin palauta mitään arvoa return lauseella, koska toistorakenteiden perään ei ole kirjoitettu return lausetta. Jonkinlaisen erillisen virhearvon palauttaminen tai poikkeuksen heittäminen ja käsitteleminen voisivat olla mahdollisia ratkaisuja.
  • Koodissa voisi olla enemmän dokumentaatiota luokkien ja metodien toiminnallisuudesta ja tarkoituksesta. Erityisesti koodin määrän kasvaessa se helpottaisi koodin ymmärtämistä.
  • Testien suorittaminen ei onnistu, vaan antaa seuraavan virheen:
    Traceback (most recent call last):
    File "test_brute_force.py", line 3, in <module>
      from bforce.brute_force import bruteForce
    ModuleNotFoundError: No module named 'bforce'
    
    En tosin ole ihan varma, osasinko suorittaa testejä oikealla tavalla. Tarvittavat komennot voisi listata README-tiedostossa.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.