Ejemplo n.º 1
0
def lmhash(password=b''):
    """
    Generates lanman password hash for a given password.

    Note that the author thinks LanMan hashes should be banished from
    the face of the earth.
    """

    if not config.useLMhash():
        return lmhash_locked()

    return passlib_lmhash.hash(password).encode('ascii').upper()
Ejemplo n.º 2
0
def _have_lmhash(password=''):
    """
    Generates lanman password hash for a given password.

    Note that the author thinks LanMan hashes should be banished from
    the face of the earth.
    """

    if not config.useLMhash():
        return lmhash_locked()

    password = (password + 14 * '\0')[:14]
    password = password.upper()

    return _deshash(password[:7]) + _deshash(password[7:])
Ejemplo n.º 3
0
def _have_lmhash(password=''):
    """
    Generates lanman password hash for a given password.

    Note that the author thinks LanMan hashes should be banished from
    the face of the earth.
    """

    if not config.useLMhash():
        return lmhash_locked()

    password = (password+14*'\0')[:14]
    password = password.upper()

    return _deshash(password[:7]) + _deshash(password[7:])
Ejemplo n.º 4
0
def _no_lmhash(password=''):
    if config.useLMhash():
        warnings.warn(
            "Cannot import Crypto.Cipher.DES, lmhash passwords disabled.")
    return lmhash_locked()
Ejemplo n.º 5
0
def _no_lmhash(password=''):
    if config.useLMhash():
        warnings.warn("Cannot import Crypto.Cipher.DES, lmhash passwords disabled.")
    return lmhash_locked()