otp(3tcl)

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

πŸ’– otp β€” One-Time Passwords πŸ’–

okay bestie, welcome to otp(3tcl) β€” the Tcl page for RFC 2289 A One-Time Password System. yes, that's the whole vibe. let's get into it 🫢


✨ NAME ✨

otp β€” One-Time Passwords πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

package require Tcl 8.5 9

package require otp ?1.1.0?

::otp::otp-md4 ?-hex? ?-words? -seed seed -count count data

::otp::otp-md5 ?-hex? ?-words? -seed seed -count count data

::otp::otp-sha1 ?-hex? ?-words? -seed seed -count count data

::otp::otp-rmd160 ?-hex? ?-words? -seed seed -count count data

look at those question marks, they're doing so much heavy lifting β€” optional args, iconic behaviour, no notes. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

So basically, this package is a Tcl implementation of the One-Time Password system as described in RFC 2289 (1). πŸ’–

The way it works? It uses message-digest algorithms to sequentially hash a passphrase and cook up single-use passwords. Then it hands the resulting data to the user in one of two formats:

  • as hexadecimal digits, or
  • encoded using a dictionary of 2048 words πŸ“

This system is used by OpenBSD for secure login, and it can also be used as a SASL mechanism for authenticating users. slay, honestly. πŸ‘‘

In this implementation we support four algorithms that ship inside the tcllib distribution:

  1. MD5 (2)
  2. MD4 (3)
  3. RIPE-MD160 (4)
  4. SHA-1 (5)

πŸ’… COMMANDS πŸ’…

here's the roster, bestie β€” four functions, all built the same way:

  • ::otp::otp-md4 ?-hex? ?-words? -seed seed -count count data β€” the MD4 flavoured one 🌸
  • ::otp::otp-md5 ?-hex? ?-words? -seed seed -count count data β€” the MD5 flavoured one ✨
  • ::otp::otp-sha1 ?-hex? ?-words? -seed seed -count count data β€” the SHA-1 flavoured one πŸ¦‹
  • ::otp::otp-rmd160 ?-hex? ?-words? -seed seed -count count data β€” the RIPE-MD160 flavoured one πŸ’œ
note how -seed and -count are not in optional brackets. they're required. you don't get to skip them. periodt. πŸ™ˆ

🌈 EXAMPLES 🌈

no -words, no -hex? you get the raw bytes, and they are not giving readable:

% otp::otp-md5 -count 99 -seed host67821 "My Secret Pass Phrase"
(binary gibberish)

want the cute word list version? say the word:

% otp::otp-md5 -words -count 99 -seed host67821 "My Secret Pass Phrase"
SOON ARAB BURG LIMB FILE WAD

want hex instead? say less:

% otp::otp-md5 -hex -count 99 -seed host67821 "My Secret Pass Phrase"
e249b58257c80087

same seed, same count, same passphrase, three whole different outfits. obsessed. πŸŽ€


πŸ“š REFERENCES πŸ“š


😭 BUGS, IDEAS, FEEDBACK 😭

ngl, this document and the package it describes will undoubtedly contain bugs and other problems. it's giving "we know". πŸ’€

Please report such in the category otp of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please also report any ideas for enhancements you may have for either package and/or documentation. we want them fr fr 🫢

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. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

SASL, md4, md5, ripemd160, sha1


⭐ KEYWORDS ⭐

hashing, message-digest, password, rfc 2289, security


🌸 CATEGORY 🌸

Hashes, checksums, and encryption


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


and that's the whole page, bestie!! πŸŽ€ this was brought to you by the fine folks over at tcllib, version 1.1.0, and it's the otp(3tcl) page β€” go forth and hash responsibly, ily πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from