otp(3tcl)
π 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:
- MD5 (2)
- MD4 (3)
- RIPE-MD160 (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-seedand-countare 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 π
- [1] Haller, N. et al., "A One-Time Password System", RFC 2289, February 1998.
http://www.rfc-editor.org/rfc/rfc2289.txt - [2] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, MIT and RSA Data Security, Inc, April 1992. (
http://www.rfc-editor.org/rfc/rfc1321.txt) - [3] Rivest, R., "The MD4 Message Digest Algorithm", RFC 1320, MIT, April 1992. (
http://www.rfc-editor.org/rfc/rfc1320.txt) - [4] H. Dobbertin, A. Bosselaers, B. Preneel, "RIPEMD-160, a strengthened version of RIPEMD"
http://www.esat.kuleuven.ac.be/~cosicart/pdf/AB-9601/AB-9601.pdf - [5] "Secure Hash Standard", National Institute of Standards and Technology, U.S. Department Of Commerce, April 1995. (
http://www.itl.nist.gov/fipspubs/fip180-1.htm)
π 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 π
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
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- Copyright (c) 2006, Pat Thoyts <patthoyts@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms