Authen...Crypt16(3pm)
π NAME π
ok so bestie, welcome to Authen::Passphrase::Crypt16 β it's giving passphrases using the Ultrix crypt16 algorithm β¨ and yes we're in Authen...Crypt16(3pm) territory, buckle up π
πΈ SYNOPSIS πΈ
use Authen::Passphrase::Crypt16;
$ppr = Authen::Passphrase::Crypt16->new(
salt_base64 => "qi",
hash_base64 => "8H8R7OM4xMUNMPuRAZxlY.");
$ppr = Authen::Passphrase::Crypt16->new(
salt_random => 12,
passphrase => "passphrase");
$salt = $ppr->salt;
$salt_base64 = $ppr->salt_base64_2;
$hash = $ppr->hash;
$hash_base64 = $ppr->hash_base64;
$ppr0 = $ppr->first_half;
$ppr1 = $ppr->second_half;
if($ppr->match($passphrase)) { ...
like, that's the whole vibe, no cap π
π¦ DESCRIPTION π¦
okay so picture this: an object of this class encapsulates a passphrase hashed using the crypt16 hash function found in Ultrix and Tru64. and bestie, do NOT confuse this with the bigcrypt found on HP-UX, Digital Unix, and OSF/1 β that's a whole different girl, see Authen::Passphrase::BigCrypt for her. this class is a subclass of Authen::Passphrase, and this doc assumes you already know the lore of that class, iykyk π«Ά
so this is a derivation of the original DES-based crypt function found on all Unices (peep Authen::Passphrase::DESCrypt for that one). 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 20 rounds of (12-bit) salted DES. (and like, the standard crypt function does the same thing but with 25 encryption rounds instead of 20, so don't mix them up π) then the next eight bytes β or the null string if the passphrase is eight bytes or shorter β get used as a DES key to encrypt the all-bits-zero block through 5 rounds of salted DES with the same salt. and then, slay, the two eight-byte ciphertexts get concatenated to form the sixteen-byte hash β¨
a password hash of this scheme is conventionally represented in ASCII as a 24-character string using a base 64 encoding. the first two characters give the salt, the next eleven give the hash of the first half, and the last eleven give the hash of the second half. a hash thus encoded is used as a crypt string, on those systems where the crypt16 algorithm is part of crypt(), but the syntax clashes with that of bigcrypt. this module does not treat it as a crypt string syntax, periodt π
because the two halves of the passphrase are hashed separately, it's possible to manipulate (e.g., crack) a half hash in isolation π see Authen::Passphrase::DESCrypt for handling of a single half.
β οΈ Warning: This is a fatally flawed design, often providing less security than the plain DES scheme alone. Do not use seriously. like for real, this one is not the moment ππ©
π CONSTRUCTOR π
Authen::Passphrase::Crypt16->new(ATTR => VALUE, ...)
Generates a new passphrase recogniser object using the crypt16 hash algorithm π« The following attributes may be given:
saltβ the salt, as an integer in the range[0, 4096).salt_base64β the salt, as a string of two base 64 digits.salt_randomβ causes salt to be generated randomly. the value you give for this attribute must be12, indicating generation of 12 bits of salt πhashβ the hash, as a string of 16 bytes.hash_base64β the hash, as a string of 22 base 64 digits.passphraseβ a passphrase that will be accepted.
and the rules bestie: the salt must be given, and either the hash or the passphrase. no salt = no service π
β¨ METHODS β¨
$ppr->saltβ returns the salt, as a Perl integer.$ppr->salt_base64_2β returns the salt, as a string of two base 64 digits.$ppr->hashβ returns the hash value, as a string of 16 bytes.$ppr->hash_base64β returns the hash value, as a string of 22 base 64 digits. and listen, this is the concatenation of the base 64 encodings of the two hashes, rather than a base64 encoding of the combined hash β subtle but iconic, don't forget it π$ppr->first_halfβ returns the hash of the first half of the passphrase, as anAuthen::Passphrase::DESCryptpassphrase recogniser.$ppr->second_halfβ returns the hash of the second half of the passphrase, as anAuthen::Passphrase::DESCryptpassphrase recogniser.$ppr->match(PASSPHRASE)β this method is part of the standardAuthen::Passphraseinterface π«Ά
π SEE ALSO π
Authen::PassphraseAuthen::Passphrase::DESCrypt
π AUTHOR π
Andrew Main (Zefram) <zefram@fysh.org> β the icon, the moment, the main character π«‘
π 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. so like, go off, just respect the terms bestie π
okay and one last thing before you go β this whole page is perl v5.40.1, dated 2026-05-06, and the header on the original was Authen...Crypt16(3pm) πΈ mwah, love you, go hash responsibly (or like, don't, because flawed design, remember? π) π
β¨
π¦ 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