Authen...gCrypt(3pm)

πŸ’… NAME πŸ’…

okay so bestie, let me put you on: Authen::Passphrase::BigCrypt β€” it's a Perl module for passphrases that use the bigcrypt algorithm. That's it, that's the whole vibe. This is Authen...gCrypt(3pm) btw, in case the man page header had you squinting. πŸ’–


✨ SYNOPSIS ✨

like, here's how you'd actually use it, no cap:

        use Authen::Passphrase::BigCrypt;

        $ppr = Authen::Passphrase::BigCrypt->new(
                salt_base64 => "qi",
                hash_base64 => "yh4XPJGsOZ2MEAyLkfWqeQ");

        $ppr = Authen::Passphrase::BigCrypt->new(
                salt_random => 12,
                passphrase => "passphrase");

        $salt = $ppr->salt;
        $salt_base64 = $ppr->salt_base64_2;
        $hash = $ppr->hash;
        $hash_base64 = $ppr->hash_base64;

        $pprs = $ppr->sections;

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so an object of this class wraps up a passphrase that's been hashed with the "bigcrypt" hash function β€” the one hanging out in HP-UX, Digital Unix, OSF/1, and a few other flavours of Unix. ⚠️ do not mix it up with the "crypt16" you'll find on Ultrix and Tru64 (that one has its own page, Authen::Passphrase::Crypt16). This class is a subclass of Authen::Passphrase, and this doc just assumes you already know that class's docs, periodt.

now for the lore: this is a lil derivation of the original DES-based crypt function that lives on literally all Unices (peep Authen::Passphrase::DESCrypt). Here's the tea 🍡 β€” the first eight bytes of the passphrase get used as a DES key to encrypt the all-bits-zero block through 25 rounds of (12-bit) salted DES, exactly like the original crypt. Then, if your passphrase is longer than eight bytes, the next eight bytes become a DES key to encrypt the all-bits-zero block through 25 rounds of salted DES, using as salt the first 12 bits of the hash of the first section. Then β€” if the passphrase is longer than sixteen bytes β€” the next eight bytes get used, with salt being the first 12 bits of the hash of the second section. And this just keeps repeating until the entire passphrase has been used up. Then all the section hashes get concatenated into the final hash. iconic behaviour honestly ✨

a password hash from this scheme is conventionally written out in ASCII using the base 64 encoding of the underlying DES-based crypt function. So: the first two characters = the salt for the first section, the next eleven = the hash of the first section, the next eleven = the hash of the second section, and so on and so on. On systems where bigcrypt is part of crypt(), a hash encoded like that gets used as a crypt string β€” but the syntax clashes with crypt16's. so heads up: this module does not treat it as a crypt string syntax.

because each section of the passphrase is hashed separately, you can totally manipulate (e.g. crack πŸ‘€) a section hash in isolation. for handling a single section, see Authen::Passphrase::DESCrypt.

⚠️ Warning, and I need you to really hear me on this one: this is a fatally flawed design, often providing less security than the plain DES scheme alone. Do not use seriously. not even a little. the vibes are rancid. πŸ’€

πŸŽ€ CONSTRUCTOR πŸŽ€

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

makes you a brand new passphrase recogniser object using the bigcrypt hash algorithm. these are the attributes you can pass in:

  • salt β€” the salt for the first section, as an integer in the range [0, 4096).
  • salt_base64 β€” the salt for the first section, as a string of two base 64 digits.
  • salt_random β€” causes the salt for the first section to be generated randomly. the value you give for this attribute must be 12, indicating generation of 12 bits of salt.
  • hash β€” the hash, as a string of bytes.
  • hash_base64 β€” the hash, as a string of base 64 digits.
  • passphrase β€” a passphrase that will be accepted.

and the rules bestie: the salt for the first section must be given, plus either the hash or the passphrase. 🫢


πŸ’œ METHODS πŸ’œ

  • $ppr->salt β€” returns the salt for the first section, as a Perl integer.
  • $ppr->salt_base64_2 β€” returns the salt for the first section, as a string of two base 64 digits.
  • $ppr->hash β€” returns the hash value, as a string of bytes.
  • $ppr->hash_base64 β€” returns the hash value, as a string of base 64 digits. heads up: this is the concatenation of the base 64 encodings of the section hashes, not a base64 encoding of the combined hash. iykyk πŸ”₯
  • $ppr->sections β€” returns a reference to an array of Authen::Passphrase::DESCrypt passphrase recognisers for the sections of the passphrase.
  • $ppr->match(PASSPHRASE) β€” this one is part of the standard Authen::Passphrase interface.

🌈 SEE ALSO 🌈

  • Authen::Passphrase
  • Authen::Passphrase::DESCrypt

πŸ‘‘ AUTHOR πŸ‘‘

Andrew Main (Zefram) <zefram@fysh.org> β€” king behaviour, we love to see it πŸ’–


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.


okay bestie that's the whole page πŸ₯° this was perl v5.40.1, dated 2026-05-06, and it's the Authen::Passphrase::BigCrypt(3pm) manual. go forth, hash responsibly (or honestly, don't β€” remember the warning 😭). mwah πŸ’…βœ¨

πŸ“¦ where this page comes from