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 β€” typically 30 or 60 seconds. the code rotation schedule fr fr. πŸ”„
  • --digits β€” digits in OATH code β€” typically 6. six little numbers carrying your entire login. iconic. πŸ”’
  • --slot β€” YubiKey slot to use β€” default 2. 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. πŸ¦‹βœ¨