YKCHALRESP(1)
YKCHALRESP(1) π
β aka ykchalresp, from the YubiKey Personalization Tool, section M of the manual
okay bestie, sit down, hydrate, because we're about to talk to a tiny USB stick and make it do math π₯
β¨ NAME β¨
ykchalresp β Perform challenge-response operation with YubiKey
πΈ SYNOPSIS πΈ
ykchalresp [-nkey] [-1 | -2] [-H | -Y] [-N] [-x] [-v] [-6 | -8] [-t]
[-iFILE] [-V] [-h]
π¦ DESCRIPTION π¦
So basically π you send a challenge to a YubiKey, and then you read the response back. That's it, that's the whole vibe. The YubiKey can be configured with two different C/R modes β the standard one is a 160 bits HMAC-SHA1, and the other one is a YubiKey OTP mimicking mode. And with that second mode, the way it works is that two subsequent calls with the same challenge will result in different responses π (yes, that's on purpose, that's the whole point, don't @ me).
π OPTIONS π
-nkeyβ send the challenge to the nth key found. key number n, bestie, not a key you type.-1β send the challenge to slot 1. This is the default π-2β send the challenge to slot 2.-Hβ send a 64 byte HMAC challenge. This is the default.-Yβ send a 6 byte Yubico OTP challenge.-Nβ non-blocking mode β abort if the YubiKey is configured to require a key press before sending the response. like, it will NOT wait around for you to tap it, it has places to be π-xβ challenge is hex encoded.-vβ enable verbose mode.-6β output the response in OATH format, 6 digits.-8β output the response in OATH format, 8 digits.-tβ use current time as challenge instead of reading challenge from command line (as in default TOTP mode, seconds since 1970-01-01 00:00:00 / 30 encoded as an 8 byte challenge). clock-based challenge, iconic β°-iFILEβ take challenge from FILE instead of as an argument. If file is-challenge is read from STDIN.-Vβ print tool version and exit.-hβ (it's in the synopsis, bestie, I'm just reporting what I see π«Ά)
π EXAMPLE π
The YubiKey challenge-response operation can be demonstrated using the NIST PUB 198 A.2 test vector. science!! π§ͺ
First, program a YubiKey with the test vector :
$ ykpersonalize -2 -ochal-resp -ochal-hmac -ohmac-lt64 -a303132333435363738393a3b3c3d3e3f40414243
...
Commit? (y/n) [n]: y
$
Now, send the NIST test challenge to the YubiKey and verify the result matches the expected :
$ ykchalresp -2 'Sample #2'
0922d3405faa3d194f82a45830737d5cc6c75d24
$
look at that hex string go π it ATE and left no crumbs.
π BUGS π
Report ykchalresp bugs in the issue tracker https://github.com/Yubico/yubikey-personalization/issues
π SEE ALSO π
The ykpersonalize home page https://developers.yubico.com/yubikey-personalization/
YubiKeys can be obtained from Yubico http://www.yubico.com/
lowkey a whole journey, highkey worth it π
k that's the whole page bestie, go forth and challenge-response responsibly. this was ykchalresp, Version 1.19.1, dated like the YKCHALRESP(1) footer says β mwah, periodt β¨ππ¦
π¦ where this page comes from
- alpine 3.24: ykpers-doc 1.20.0-r2 Β· BSD-2-Clause
- arch rolling: yubikey-personalization 1.20.0-5 Β· BSD
- debian bookworm: yubikey-personalization 1.20.0-3 Β· BSD-2-Clause
- debian trixie: yubikey-personalization 1.20.0-5 Β· BSD-2-Clause
- epel 10: ykpers 1.20.0-15.el10_1 Β· LicenseRef-Callaway-BSD
- epel 9: ykpers 1.20.0-9.el9 Β· BSD
- fedora 43: ykpers 1.20.0-17.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: ykpers 1.20.0-17.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: ykpers 1.20.0-18.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: ykpers 1.20.0-18.fc44 Β· LicenseRef-Callaway-BSD
- nixos 26.05: yubikey-personalization 1.20.0
- nixpkgs unstable: yubikey-personalization 1.20.0
- ubuntu jammy: yubikey-personalization 1.20.0-3 Β· BSD-2-Clause
- ubuntu noble: yubikey-personalization 1.20.0-3build1 Β· BSD-2-Clause
- ubuntu questing: yubikey-personalization 1.20.0-6
- ubuntu resolute: yubikey-personalization 1.20.0-7 Β· BSD-2-Clause
- ubuntu stonking: yubikey-personalization 1.20.0-7 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms