Are YubiKey's HMAC-SHA1 responses actually 20 bytes, or are they truncated? #11608
-
While the output length of SHA-1 is obviously 20 bytes, and that's also the length that KeePassXC's code assumes being returned by YubiKey's HMAC-SHA1, I'm wondering whether that is actually the case? Yubico's documentation seems to hint at the response being truncated to 6-10 digits. When using a YubiKey as a second factor for unlocking the database, obviously 6-10 digits would add only limited additional protection over the master secret, and would be reasonable to brute force, if the master secret got leaked. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes it is actually 20 bytes, see the Yubikey code here: keepassxc/src/thirdparty/ykcore/ykcore.c Lines 370 to 407 in fb022cb I have no idea what the documentation is even saying by 6-10 digits, that makes zero sense It's hard to tell because the response is literal bytes (not digits), but you can see the response is 20 bytes + residual which is then truncated to 20 bytes of data (the actual response): |
Beta Was this translation helpful? Give feedback.
Yes it is actually 20 bytes, see the Yubikey code here:
keepassxc/src/thirdparty/ykcore/ykcore.c
Lines 370 to 407 in fb022cb