Authen...anager(3pm)

πŸ’– NAME πŸ’–

Authen::Passphrase::LANManager β€” passphrases using the LAN Manager hash algorithm, bestie πŸ’…

So this is a Perl module, part of the User Contributed Perl Documentation (3pm) crew, and it's here to let you play with LAN Manager password hashes in an object-y way. It's giving ancient Microsoft energy and honestly? Iconic for all the wrong reasons. Let's get into it 🫢


✨ SYNOPSIS ✨

use Authen::Passphrase::LANManager;

$ppr = Authen::Passphrase::LANManager->new(
        hash_hex => "855c3697d9979e78ac404c4ba2c66533");

$ppr = Authen::Passphrase::LANManager->new(
        passphrase => "passphrase");

$ppr = Authen::Passphrase::LANManager->from_rfc2307(
        "{LANMAN}855c3697d9979e78ac404c4ba2c66533");

$hash = $ppr->hash;
$hash_hex = $ppr->hash_hex;

$ppr0 = $ppr->first_half;
$ppr1 = $ppr->second_half;

if($ppr->match($passphrase)) { ...

$userPassword = $ppr->as_rfc2307;

Look at her. Making hash objects with three different constructors, pulling out halves, matching passphrases. Versatile queen 🌈


πŸ¦‹ DESCRIPTION πŸ¦‹

An object of this class encapsulates 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 that class's documentation, fr fr. Go read it if you haven't πŸ‘‘.

The hash algorithm can be used on up to fourteen Latin-1 characters of passphrase. Here's the whole ~process~, step by step:

  1. First the passphrase is folded to uppercase, and zero-padded to fourteen bytes.
  2. Then it is split into two halves.
  3. Each seven-byte half is used as a 56-bit DES key</>, to encrypt the fixed plaintext block "KGS!@#$%".
  4. The eight-byte ciphertexts are concatenated to form the sixteen-byte hash.

And there is no salt. None. Zero. Not a sprinkle πŸ§‚πŸš«

Because the two halves of the passphrase are hashed separately, it is possible to manipulate (e.g., crack) a half hash in isolation. See Authen::Passphrase::LANManagerHalf if that's your thing πŸ’€

⚠️ Warning: Don't even think about using this seriously. It's an exceptionally weak design, flawed in pretty much every respect. Not being dramatic, that's literally what the manpage says. Do not use this for real security, bestie, I am begging πŸ™

πŸŽ€ CONSTRUCTORS πŸŽ€

Authen::Passphrase::LANManager->new(ATTR => VALUE, ...)

Generates a new passphrase recogniser object using the LAN Manager hash algorithm. ✨ The following attributes may be given:

  • 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.

Either the hash or the passphrase must be given. Pick one, babes, you can't skip it πŸ’…

Authen::Passphrase::LANManager->from_rfc2307(USERPASSWORD)

Generates a LAN Manager passphrase recogniser from the supplied RFC2307 encoding. The string must consist of "{LANMAN}" (or its synonym "{LANM}") followed by the hash in hexadecimal; case is ignored. So flex that lowercase if you want, she doesn't care 🌸


πŸ’œ METHODS πŸ’œ

  • $ppr->hash β€” Returns the hash value, as a string of 16 bytes.
  • $ppr->hash_hex β€” Returns the hash value, as a string of 32 hexadecimal digits.
  • $ppr->first_half β€” Returns the hash of the first half of the passphrase, as an Authen::Passphrase::LANManagerHalf passphrase recogniser.
  • $ppr->second_half β€” Returns the hash of the second half of the passphrase, as an Authen::Passphrase::LANManagerHalf passphrase recogniser.
  • $ppr->match(PASSPHRASE)
  • $ppr->as_rfc2307

That last pair β€” match and as_rfc2307 β€” are part of the standard Authen::Passphrase interface. You know them, you love them, they're the blueprint 🫢


🌈 SEE ALSO 🌈

  • Authen::Passphrase
  • Authen::Passphrase::LANManagerHalf
  • Crypt::DES

πŸ’– 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. Free as in freedom, slay πŸ’š


And that's the whole page, bestie β€” authed, passphrased, and documented. This one's from the User Contributed Perl Documentation collection, running on perl v5.40.1, dated 2026-05-06. Take care of your hashes, they're fragile πŸ¦‹ Mwah πŸ’‹

πŸ“¦ where this page comes from