# OnlyKey and Yubikey HMAC Issue

**URL:** <https://onlykey.discourse.group/t/onlykey-and-yubikey-hmac-issue/465>\
**Category:** Two Factor Authentication\
**Created:** [August 5, 2021, 2:26am UTC](https://onlykey.discourse.group/t/onlykey-and-yubikey-hmac-issue/465 "2021-08-05T02:26:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ueGYQmsU0GZU](https://avatars.discourse-cdn.com/v4/letter/u/eb8c5e/32.png) [@ueGYQmsU0GZU](https://onlykey.discourse.group/u/ueGYQmsU0GZU)\
**Post date:** [August 5, 2021, 2:26am UTC](https://onlykey.discourse.group/t/onlykey-and-yubikey-hmac-issue/465/1 "2021-08-05T02:26:01Z")

</div>

Hello,

I am not getting HMAC mismatch errors when trying to use HMAC between my Onlykey and Yubikey. I set both devices with the same 40 character key following the user guide.

Has anyone had any success?

---

<div class="post-metadata">

**Author:** ![t11](https://avatars.discourse-cdn.com/v4/letter/t/8e7dd6/32.png) [@t11](https://onlykey.discourse.group/u/t11)\
**Post date:** [August 5, 2021, 5:33pm UTC](https://onlykey.discourse.group/t/onlykey-and-yubikey-hmac-issue/465/2 "2021-08-05T17:33:59Z")

</div>

I can confirm this works. A common issue is that the custom HMAC key was not loaded successfully on OnlyKey, in which case the OnlyKey will continue to use the default key instead of your custom key. To load make sure you are using a 20 byte key, you can use a tool like the Yubikey personalization tool to generate a random one.

To load with CLI app instructions are [here](https://docs.crp.to/usersguide.html#challenge-response), to load through the GUI app make sure to pad the end with 0s like this:

```auto
0102030405060708091011121314151617181920000000000000000000000000

```

 ![image](https://global.discourse-cdn.com/free1/uploads/onlykey/original/1X/7f9f6d6994b4f94b06320c3367cb542541cfb1c7.png)

You will see a success message indicating it loaded successfully

 ![image](https://global.discourse-cdn.com/free1/uploads/onlykey/original/1X/1cc480cd899137a6b9e918132f6755eb85452300.png)

---

<div class="post-metadata">

**Author:** ![ueGYQmsU0GZU](https://avatars.discourse-cdn.com/v4/letter/u/eb8c5e/32.png) [@ueGYQmsU0GZU](https://onlykey.discourse.group/u/ueGYQmsU0GZU)\
**Post date:** [August 6, 2021, 7:01pm UTC](https://onlykey.discourse.group/t/onlykey-and-yubikey-hmac-issue/465/3 "2021-08-06T19:01:24Z")

</div>

Thanks for taking the time to reply.

I originally did the CLI version (which was giving me issues in the post). Tried using the GUI and padding with zeros, works great, confirmed it worked a few times, and confirmed the yubikey worked as well.

You made my week! Thanks again for the support.
