Authen...NTHash(3pm)
π Authen::Passphrase::NTHash β the manual page, but make it make sense π
okay bestie, so this is Authen::Passphrase::NTHash(3pm), straight out of the User Contributed Perl Documentation corner of the Perl universe. It's the whole NT-Hash passphrase situation, explained with love. let's go π¦
β¨ NAME β¨
Authen::Passphrase::NTHash β passphrases using the NT-Hash algorithm. that's it, that's the name, she's iconic and she's exactly what she says on the tin π
π SYNOPSIS π
here's the vibe, code and all β literally copy-paste energy:
use Authen::Passphrase::NTHash;
$ppr = Authen::Passphrase::NTHash->new(
hash_hex => "7f8fe03093cc84b267b109625f6bbf4b");
$ppr = Authen::Passphrase::NTHash->new(
passphrase => "passphrase");
$ppr = Authen::Passphrase::NTHash->from_crypt(
'$3$$7f8fe03093cc84b267b109625f6bbf4b');
$ppr = Authen::Passphrase::NTHash->from_rfc2307(
'{MSNT}7f8fe03093cc84b267b109625f6bbf4b');
$hash = $ppr->hash;
$hash_hex = $ppr->hash_hex;
if($ppr->match($passphrase)) { ...
$passwd = $ppr->as_crypt;
$userPassword = $ppr->as_rfc2307;
πΈ DESCRIPTION πΈ
so, an object of this class is basically a little vessel that holds a passphrase hashed with the NT-Hash function. that's the whole point of her existence π«Ά
β οΈ important: she is a subclass of Authen::Passphrase, and this doc assumes you already know your way around that class's documentation. if you don't, go read that first, no cap.
now the actual tea: the NT-Hash scheme rides on the MD4 digest algorithm. here's how it works β up to 128 characters of passphrase get represented in Unicode, and anything past the 128th character is ignored (yes, straight up thrown away π), and then the whole thing is hashed using MD4. and the salt? there is no salt. none. zero. not a single grain. No salt is used. periodt.
Warning: MD4 is a weak hash algorithm by current standards, and the lack of salt is a design flaw in this scheme. Use this for compatibility only, not by choice. π¨ like, fr fr, this is a compatibility moment, not a make-good-life-choices moment.
π« CONSTRUCTORS π«
Authen::Passphrase::NTHash->new(ATTR => VALUE, ...)
makes you a shiny new passphrase recogniser object using the NT-Hash algorithm β¨ you can pass it these attributes:
hashβ the hash, as a string of 16 bytes.hash_hexβ the hash, as a string of 32 hexadecimal digits.passphraseβ a passphrase that will be accepted.
π¨ you must give either thehashor thepassphrase. pick one, bestie, them's the rules.
Authen::Passphrase::NTHash->from_crypt(PASSWD)
builds you a new NT-Hash passphrase recogniser object out of a crypt string. two forms are accepted, so listen up π
- first form: the crypt string has to be
"$3$$"β and yes, note that extra"$", she's not a typo, she's a feature β followed by the hash in lowercase hexadecimal. - second form: the crypt string has to be
"$NT$"followed by the hash in lowercase hexadecimal.
Authen::Passphrase::NTHash->from_rfc2307(USERPASSWORD)
same energy but for an RFC 2307 string. two forms are accepted again:
- first form: the string has to be
"{MSNT}"followed by the hash in hexadecimal β and case is ignored here, so do you π - second form: the string has to be
"{CRYPT}"(case insensitive, queen) followed by an acceptable crypt string.
π METHODS π
$ppr->hash
hands you back the hash value, as a string of 16 bytes π
$ppr->hash_hex
hands you back the hash value, as a string of 32 hexadecimal digits β
$ppr->match(PASSPHRASE)
$ppr->as_crypt
$ppr->as_rfc2307
these three? they're all part of the standard Authen::Passphrase interface. nothing extra, nothing invented, just the classic trio doing their thing π
π SEE ALSO π
Authen::PassphraseDigest::MD4
go read them, they're the supporting cast and they ate π
π§ AUTHOR π§
Andrew Main (Zefram) <zefram@fysh.org> β absolute legend, respect on the name π
π COPYRIGHT π
Copyright (C) 2006, 2007, 2009, 2010, 2012 Andrew Main (Zefram) <zefram@fysh.org>
π LICENSE π
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, and legally so π«Ά
and that's the whole page bestie!! π
this was served up with perl v5.40.1, dated 2026-05-06, and yes the title really is Authen...NTHash(3pm) β those dots are just the manpage being mysterious and cute. go forth and be compatibility-only about it πβ¨
π¦ where this page comes from
- ubuntu stonking: libauthen-passphrase-perl 0.009-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms