PEAR Manual
Prev |  | Next

# Crypt_CHAP_MSCHAPv1::lmPasswordHash()

Crypt_CHAP_MSCHAPv1::lmPasswordHash() -- Generates the LAN-Manager-Hash from the given plaintext-password.

## Synopsis

``string Crypt_CHAP_MSCHAPv1::lmPasswordHash` ([string $password = ''])`

## Description

This method generates LAN-Manager-Hash from the given plaintext-password or from the password property.

## Parameter

- `string $password` - the password to be hashed

## Return value

`string` - a String containing the LAN-Manager-Hash

## Note

This function can not be called statically.

LAN-Manager Hash are weak and should not be used anymore.

## Example

Example 35-1. Using Crypt_CHAP_MSCHAPv1::lmPasswordHash()
    <?php
    require_once 'Crypt/CHAP.php';

    $cr = new Crypt_CHAP_MSCHAPv1();
    $cr->password = 'MyPw';
    echo bin2hex($cr->lmPasswordHash());

    // or
    echo bin2hex($cr->lmPasswordHash('MySecret'));

    ?>

Prev | Home | Next
Crypt_CHAP_MSCHAPv1::ntPasswordHash() | Up | Crypt_CHAP_MSCHAPv1::str2unicode()