Coder Social home page Coder Social logo

mistypography's Introduction

MISTYPOGRAPHY

This module implements different typo correction strategies discussed in https://www.cs.cornell.edu/~rahul/papers/pwtypos.pdf. For more details please refer to the project page https://www.cs.cornell.edu/~rahul/projects/pwtypos.html.

REQUIREMENTS

  • Install pwmodel from here
$ pip install git+https://github.com/rchatterjee/pwmodels.git

This should install all the dependencies, if not, you may have to install python-Levenshtein.

$ pip install python-Levenshtein

INSTALL

$ pip install git+https://github.com/rchatterjee/mistypography.git

HOW TO USE?

To allow online typo correction, a set of corrected version of the mistyped password is created, and then each of them is tested against the real password hash. This code only generates the possible set of corrections (a.k.a. ball). The simplest way to do this is to use one of the built-in checkers (BUILT_IN_CHECKERS) in typofixer/checker.py file. Descriptions of these checkers is given in the checker.py file.

You can also instantiate your own Checker. To instanticate a checker we need two arguments, first, a set of correctors which you can see the names given in common.py, and second, a policy number which will tune the checker to use one of the given policies (ChkAll, ChkBl etc.).

Note, the checker needs the data directory to be in the same folder. You can move the data directory and change path DATA_DIR_PATH in common.py accordingly.

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from typofixer.checker import BUILT_IN_CHECKERS

>>> chk = BUILT_IN_CHECKERS['ChkAllTop3']

>>> chk = BUILT_IN_CHECKERS['ChkAllTop3'] 

>>> chk.check('password')
set(['passwor', 'Password', 'PASSWORD', 'password'])

>>> chk_bl = BUILT_IN_CHECKERS['ChkBlTop3']

>>> chk_bl.check('password')
set(['passwor', 'password'])

>>> >>> chk_all = BUILT_IN_CHECKERS['ChkAllTop5']

>>> chk_all.check('password1')
set(['assword1', 'PASSWORD1', 'Password1', 'password!', 'password', 'password1'])

CONTACT

Rahul Chatterjee ([email protected])

mistypography's People

Contributors

rchatterjee avatar jacobiu avatar

Watchers

James Cloos avatar Rhenium avatar

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.