md5crypt(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– md5crypt β€” the manual page, but make it cute πŸ’–

okay bestie, you're reading md5crypt(3tcl), and honestly? she's an icon. password hashing, but make it ✨vibes✨. let's go 🫢


✨ NAME ✨

md5crypt β€” MD5-based password encryption. that's it, that's the whole name, and she's serving πŸŽ€


🌸 SYNOPSIS 🌸

package require Tcl 8.5 9

package require md5 2.0

package require md5crypt ?1.2.0?

::md5crypt::md5crypt password salt

::md5crypt::aprcrypt password salt

::md5crypt::salt ?length?

πŸ’… DESCRIPTION πŸ’…

so basically, this package gives you an implementation of the MD5-crypt password encryption algorithm β€” the one FreeBSD pioneered, and the one that's currently out here replacing the unix crypt(3) function on a whole bunch of modern systems. main character energy, truly. πŸ”₯

and because one slay wasn't enough, there's also an implementation of the closely related Apache MD5-crypt available too. you're welcome. πŸ’β™€οΈ

the way that this matters: the output of these commands is compatible with the BSD and OpenSSL implementation of md5crypt, and also with the Apache 2 htpasswd program. no cap. πŸ‘‘


πŸ¦‹ COMMANDS πŸ¦‹

  • ::md5crypt::md5crypt password salt β€” generates a BSD compatible md5-encoded password hash from the plaintext password and a random salt (peep the SALT section below, bestie πŸ“–).
  • ::md5crypt::aprcrypt password salt β€” generates an Apache compatible md5-encoded password hash from the plaintext password and a random salt (again, SALT section, iykyk).
  • ::md5crypt::salt ?length? β€” generates a random salt string that's suitable for use with the md5crypt and aprcrypt commands. little salt fairy, doing her thing βœ¨πŸ§‚

πŸ§‚ SALT πŸ§‚

here's the tea on salt, and it's lowkey important so listen up:

the salt you pass to either of the encryption schemes implemented here gets checked to see if it begins with the encryption scheme magic string β€” that's either "$1$" for MD5-crypt, or "$apr1$" for Apache crypt. if it does? that bit gets removed. βœ‚οΈ

then the remaining characters, up to the next $ and up to a maximum of 8 characters, are used as the salt. periodt.

also, the salt text should probably be restricted to the set of ASCII alphanumeric characters plus "./" (dot and forward-slash) β€” this is to preserve maximum compatibility with the unix password file format. it's giving responsible queen. πŸ’–

and if you're generating a password rather than checking one from a password file, then the salt command may be used to generate a random salt. easy. 🌈


🌟 EXAMPLES 🌟

look at her go:

% md5crypt::md5crypt password 01234567
$1$01234567$b5lh2mHyD2PdJjFfALlEz1

% md5crypt::aprcrypt password 01234567
$apr1$01234567$IXBaQywhAhc0d75ZbaSDp/

% md5crypt::md5crypt password [md5crypt::salt]
$1$dFmvyRmO$T.V3OmzqeEf3hqJp2WFcb.

ate. no crumbs. 😭πŸ”₯


πŸ’€ BUGS, IDEAS, FEEDBACK πŸ’€

ngl, this is the part where we keep it real:

this document, and the package it describes, will undoubtedly contain bugs and other problems. not me being dramatic, that's literally what it says. πŸ™ˆ

please report such in the category md5crypt of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist]. and please also report any ideas for enhancements you may have for either the package and/or the documentation. we're listening, bestie 🫢

when proposing code changes, please provide unified diffs, i.e the output of diff -u.

note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. yes, that specific button. that one. πŸ‘ˆ


πŸ‘€ SEE ALSO πŸ‘€

  • md5

πŸ”‘ KEYWORDS πŸ”‘

hashing, md5, md5crypt, message-digest, security


πŸ—‚οΈ CATEGORY πŸ—‚οΈ

Hashes, checksums, and encryption


Copyright (c) 2003, Pat Thoyts <patthoyts@users.sourceforge.net>


and that's the whole page, bestie!! πŸŽ€ this was brought to you by tcllib, version 1.2.0, serving from the md5crypt(3tcl) manual. stay salty (cryptographically speaking) πŸ§‚πŸ’œβœ¨

πŸ“¦ where this page comes from