Authen...::Util(3pm)

πŸ“¦
version 0.171 Β· 2 versions
  • 0.171 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.171 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Authen::Htpasswd::Util πŸ’–

okay bestie, so this is Authen::Htpasswd::Util β€” it does the encryption for all the .htpasswd formats it supports. that's the whole vibe. it's a Perl module, it lives in your 3pm section, and it's here to make passwords go ✨scrambled✨ in exactly the ways .htpasswd expects. no cap.


🌸 METHODS 🌸

πŸŽ€ htpasswd_encrypt

htpasswd_encrypt($hash,$password,$hashed_password);

so like, this one takes your plain little $password (the cleartext, the raw tea, the un-encrypted truth) and encrypts it using whatever $hash you told it to use. the valid values for $hash are literally "md5", "sha1", "crypt", or "plain" β€” that's the whole menu, no secret extra options hiding in the back.

now here's the important part, pay attention bestie πŸ‘€ β€” for "crypt" and "md5", sometimes you have to pass the old encrypted password in as $hashed_password. why? so the new one uses the correct salt. the salt matters. the salt is the moment. without it you might get a different result than you wanted and that's not the vibe.

this one is exported by default, so it just shows up in your namespace like it owns the place. main character energy fr.


πŸ¦‹ supported_hashes

my @hashes = Authen::Htpasswd::Util::supported_hashes();

this gives you back an array of the hash types that are actually available on your system β€” like a little vibe check for your crypto setup, iykyk.

the deets:

  • "crypt" and "plain" β€” always available, always there for you, ride or die πŸ’…
  • "sha1" β€” it checks this one by attempting to load it via Digest. so it's a "try it and see" situation, lowkey.
  • "md5" β€” this one requires Crypt::PasswdMD5. no module, no md5. periodt.

πŸ‘‘ AUTHOR πŸ‘‘

David Kamholz <dkamholz@cpan.org>

Yuval Kogman


Copyright (c) 2005 - 2007 the aforementioned authors.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page bestie 🫢 this beauty is from perl v5.36.0, dated 2022-11-20, and yes the manual page is Authen...::Util(3pm) β€” iconic, timeless, slay πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from