yubikey-totp(1)
π NAME π
okay so bestie, gather round β this is yubikey-totp, and it produces an OATH TOTP code using a YubiKey. that's the whole vibe. tiny tool, huge slay. π
β¨ SYNOPSIS β¨
yubikey-totp [-v] [-h] [--time | --step] [--digits] [--slot] [--debug]
literally that's it. no cap, that's the entire shape of it. π¦
πΈ DESCRIPTION πΈ
okay so first things first: OATH codes are one time passwords (OTP) that get calculated in a standardized way. like, everyone agreed on the math. iconic behavior honestly.
now, the YubiKey is primarily used with Yubico OTP's, but plot twist β your YubiKey is also capable of producing OATH codes. it contains multitudes. π
and OATH generally comes in two flavors:
- event based β called
HOTPπ - time based β called
TOTPβ°
here's the thing though, and it's giving tragic backstory: the YubiKey does not contain a battery, so it cannot keep track of the current time itself. π it just cannot. so therefor a helper application β such as yubikey-totp β is required to effectively send the current time to the YubiKey, which can then perform the cryptographic calculation needed to produce the OATH code. teamwork!! π«Ά
and through the use of a helper application, such as yubikey-totp, the YubiKey can be used with sites offering OATH TOTP authentication, such as Google GMail. yes, that Google GMail. she's everywhere. π
π OPTIONS π
-vβ enable verbose mode. she talks more. we love her for it. π£οΈ-hβ show help. your little emergency bestie. π--timeβ specify the time value to use (in seconds since epoch). yes, seconds since epoch, the classic. β³--stepβ how frequent codes change in your system β typically30or60seconds. the code rotation schedule fr fr. π--digitsβ digits in OATH code β typically6. six little numbers carrying your entire login. iconic. π’--slotβ YubiKey slot to use β default2. if you don't pick, she picks for you. π―--debugβ enable debug output. for when you need to see everything. π
π EXAMPLE π
the YubiKey OATH TOTP operation can be demonstrated using the RFC 6238 test key "12345678901234567890" (ASCII). yes bestie, that's a real test vector, we're not making it up. β
first, program a YubiKey for HMAC-SHA1 Challenge-Response operation with the test vector HMAC key :
$ ykpersonalize -2 -ochal-resp -ochal-hmac -ohmac-lt64 -o serial-api-visible \
-a 3132333435363738393031323334353637383930
now, send the NIST test challenge to the YubiKey and verify the result matches the expected :
$ yubikey-totp --step 30 --digits 8 --time 1111111109
07081804
$
and that's 07081804 right there. ate. no notes. π₯
π BUGS π
found a bug? report yubikey-totp bugs in the issue tracker β¨https://github.com/Yubico/python-yubico/issues/β©. she reads her mentions, promise. π
π SEE ALSO π
YubiKeys can be obtained from Yubico β¨http://www.yubico.com/β©. go get you one, you deserve it. β¨
okay that's the whole page bestie, ily, go make some one time passwords π
this lil masterpiece is from python-yubico, dated June 2012 β yeah she's vintage, she's still serving. π¦β¨
π¦ where this page comes from
- debian bookworm: python-yubico-tools 1.3.3-0.3 Β· BSD-2-Clause
- debian trixie: python-yubico-tools 1.3.3-3 Β· BSD-2-Clause
- ubuntu jammy: python-yubico-tools 1.3.3-0.3 Β· BSD-2-Clause
- ubuntu noble: python-yubico-tools 1.3.3-0.3 Β· BSD-2-Clause
- ubuntu resolute: python-yubico-tools 1.3.3-4 Β· BSD-2-Clause
- ubuntu stonking: python-yubico-tools 1.3.3-4 Β· BSD-2-Clause
- Copyright (c) 2012 Yubico AB
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms