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 (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