HOWTOs :: LM NT algorithm in PHP
Last modified on Tuesday November 28 2006 @ 17:15:13
problem
Need to implement the Windows LM and NT ancryption algorithm in PHP for an application I'm writing.
analysis
I found that Samba's mkntpwd has been deprecated as of 2004-04-07. However, it it still available here:
http://www.demog.berkeley.edu/~aperrin/tips/src/mkntpwd.tar.gz.
I didn't want to use a binary for my PHP app, so I ended up using PHPLDAPAdmin's
createlm.php.
example
Here follows a code example on how to use it:
<?
...
/**
* Import the createLM class from PHP LDAP ADMIN
*/
include_once('createlm.php');
$strPassword = "my password here";
// Generate hash pair
echo "NT hash generated : " . $smbhash->nthash( $strPassword );
echo "LM hash generated : " . $smbhash->lmhash( $strPassword );
...
?>
|
|