4.1 Example
Keywords: manual

##
4.1 Example

The following example shows how to check a password using the `crack` module.

    >>> import crack
    >>> crack.FascistCheck("abcdefghilmn")
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "/usr/lib/python2.2/site-packages/crack.py", line 194, in VeryFascistCheck
        return FascistCheck(new, dictpath)
    ValueError: it is too simplistic/systematic
    >>> crack.FascistCheck("secret")
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    ValueError: it is based on a dictionary word
    >>> crack.VeryFascistCheck("secret", "scrt")
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "/usr/lib/python2.2/site-packages/crack.py", line 187, in VeryFascistCheck
        raise ValueError, "is too similar to the old one"
    ValueError: is too similar to the old one
    >>> crack.VeryFascistCheck("secret", "cretse")
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "/usr/lib/python2.2/site-packages/crack.py", line 185, in VeryFascistCheck
        raise ValueError, "is rotated"
    ValueError: is rotated
    >>> crack.FascistCheck("this is a really secure secret but do not use it!!")
    'this is a really secure secret but do not use it!!'