Authen...erHalf(3pm)
π NAME π
Authen::Passphrase::LANManagerHalf β bestie, this is for passphrases that use half the LAN Manager algorithm. Half. Like, one half of a cursed sandwich π₯ͺπ
β¨ SYNOPSIS β¨
use Authen::Passphrase::LANManagerHalf;
$ppr = Authen::Passphrase::LANManagerHalf->new(
hash_hex => "855c3697d9979e78");
$ppr = Authen::Passphrase::LANManagerHalf->new(
passphrase => "passphr");
$ppr = Authen::Passphrase::LANManagerHalf->from_crypt(
'$LM$855c3697d9979e78');
$ppr = Authen::Passphrase::LANManagerHalf->from_rfc2307(
'{CRYPT}$LM$855c3697d9979e78');
$hash = $ppr->hash;
$hash_hex = $ppr->hash_hex;
if($ppr->match($passphrase)) { ...
$passwd = $ppr->as_crypt;
$userPassword = $ppr->as_rfc2307;
like literally just look at it, it's giving β¨cryptographic regretβ¨
πΈ DESCRIPTION πΈ
Okay so. An object of this class encapsulates half of a passphrase hashed using the Microsoft LAN Manager hash function. It's a subclass of Authen::Passphrase, and this doc just assumes you already know what's up with that class, mkay? If you want the complete LAN Manager hash function, go read Authen::Passphrase::LANManager instead, boo.
So here's the tea β β in a spectacularly bad design decision (their words, and honestly? iconic of Microsoft), the Microsoft LAN Manager hash function splits the passphrase into two parts and hashes them separately. Which means you can pull the halves apart and do stuff with them (like, say, crack them) totally independently. π« This class is all about using one of those hash halves on its own.
The half hash algorithm works on up to seven Latin-1 characters of passphrase. So first the passphrase gets folded to uppercase, then zero-padded to seven bytes. Then those seven bytes are used as a 56-bit DES key, to encrypt the fixed plaintext block "KGS!@#$%". The eight byte ciphertext block? That's your half hash. And nope, there's no salt. zero. none. nada. π
Warning: Don't even think about using this seriously. It's an exceptionally weak design, flawed in pretty much every respect. Not me being dramatic β that's literally the manpage. Please do not ship this. fr fr.
π CONSTRUCTORS π
Authen::Passphrase::LANManagerHalf->new(ATTR => VALUE, ...)β spins up a brand new passphrase recogniser object using the LAN Manager half hash algorithm. You can pass in these attributes:hashβ the hash, as a string of 8 bytes.hash_hexβ the hash, as a string of 16 hexadecimal digits.passphraseβ a passphrase that will be accepted.
Either the hash or the passphrase must be given. pick one bestie, not both-and-not-neither π
Authen::Passphrase::LANManagerHalf->from_crypt(PASSWD)β makes you a fresh LAN Manager half passphrase recogniser object from a crypt string. That crypt string has to consist of"$LM$"followed by the hash in lowercase hexadecimal. lowercase only, she's picky πAuthen::Passphrase::LANManagerHalf->from_rfc2307(USERPASSWORD)β makes a new LAN Manager half passphrase recogniser object from an RFC 2307 string. The string must be"{CRYPT}"(case insensitive, we're flexible here) followed by an acceptable crypt string.
π METHODS π
$ppr->hashβ returns the hash value, as a string of 8 bytes.$ppr->hash_hexβ returns the hash value, as a string of 16 hexadecimal digits.$ppr->match(PASSPHRASE)$ppr->as_crypt$ppr->as_rfc2307
These methods are part of the standard Authen::Passphrase interface. Standard behaviour, no surprises, they ate. π
π¦ SEE ALSO π¦
Authen::Passphrase, Authen::Passphrase::LANManager, Crypt::DES
go read those if you want the full picture, iykyk π«Ά
π AUTHOR π
Andrew Main (Zefram) <zefram@fysh.org>
π 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 that's the whole thing bestie!! this page came from the Authen...erHalf(3pm) page (yup the truncated title is literally how it shows up, no notes) β User Contributed Perl Documentation, perl v5.40.1, dated 2026-05-06. go forth and do not use this for anything real, mwah ππΈ
π¦ 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