Skip to content
Fixing annoying password typos during login
Branch: master
Clone or download
Rahul Chatterjee
Rahul Chatterjee Imrpoving secruity analysis
Latest commit f0fb62c Nov 24, 2016
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Fixing and upgrading to python3 Sep 8, 2016
typofixer New all edit security loss script Sep 16, 2016


This module implements different typo correction strategies discussed in For more details please refer to the project page


  • Install pwmodel from here
$ pip install git+

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

$ pip install python-Levenshtein


$ pip install git+


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/ file. Descriptions of these checkers is given in the 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, 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 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'])


Rahul Chatterjee (

You can’t perform that action at this time.