# FIDO U2F plugin?

**URL:** https://community.keyboard.io/t/fido-u2f-plugin/484
**Category:** Programming
**Created:** [October 21, 2017, 4:25am UTC](https://community.keyboard.io/t/fido-u2f-plugin/484 "2017-10-21T04:25:58Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![nornagon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/nornagon/32/468_2.png) [@nornagon](https://community.keyboard.io/u/nornagon)
#### Post date: [October 21, 2017, 4:25am UTC](https://community.keyboard.io/t/fido-u2f-plugin/484/1 "2017-10-21T04:25:58Z")

</div>

U2F, or [Universal Second Factor](https://www.yubico.com/solutions/fido-u2f/) is a newish standard for 2FA that adds an extra layer of crypto-based security on top of traditional 2FA methods like SMS or time-based codes. U2F devices store private keys, indexed by web origin, and when you want to log in, the browser communicates with the device and asks it to sign a challenge presented by the server (which holds the public key). The device flashes a light, you press a button, and the device sends back the signed challenge. The server checks the signature and logs you in.

I’m not sure if there’s enough room on the ATmega32U4 to fit both the keyboard firmware and a crypto library, but there’s [prior art](https://github.com/pratikd650/Teensy_U2F) for making an Arduino-based U2F key anyhow 🙂

---

<div class="post-metadata">

### Author: ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)
#### Post date: [October 21, 2017, 5:03am UTC](https://community.keyboard.io/t/fido-u2f-plugin/484/2 "2017-10-21T05:03:59Z")

</div>

I think the Atmega32u4 lacks the capacity required for this. ~28k flash, and 2k SRAM is - I think - too small to have both an U2F implementation and keyboard firmware in it.

On the other hand, the [micro-ecc](https://github.com/kmackay/micro-ecc) library, that implements the crypto parts does support AVR, and may even fit in size… and ECC keys are small (32 bytes or so), so we may even be able to store them.

Oh boy.

---

<div class="post-metadata">

### Author: ![jesse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jesse/32/361_2.png) [@jesse](https://community.keyboard.io/u/jesse)
#### Post date: [October 21, 2017, 5:12am UTC](https://community.keyboard.io/t/fido-u2f-plugin/484/3 "2017-10-21T05:12:15Z")

</div>

> [@nornagon](#):
>
> I’m not sure if there’s enough room on the ATmega32U4 to fit both the keyboard firmware and a crypto library, but there’s prior art for making an Arduino-based U2F key anyhow 🙂

That’s a Teensy 3, which is a much more powerful ARM.

It’s worth writing a trivial sketch and seeing how big the code is. From there, we can think about optimization.

---

<div class="post-metadata">

### Author: ![bjn](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/bjn/32/5337_2.png) [@bjn](https://community.keyboard.io/u/bjn)
#### Post date: [October 21, 2017, 5:38am UTC](https://community.keyboard.io/t/fido-u2f-plugin/484/4 "2017-10-21T05:38:09Z")

</div>

I’ve seen storage issues being brought up a few times now. Is there any kind of possible mod which would increase storage capacity for those who want to do fancier things with their keyboard?

---

<div class="post-metadata">

### Author: ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)
#### Post date: [October 21, 2017, 5:42am UTC](https://community.keyboard.io/t/fido-u2f-plugin/484/5 "2017-10-21T05:42:56Z")

</div>

You could - at least in theory - attach an external EEPROM chip to the keyboard, significantly increasing its storage capacity.

---

<div class="post-metadata">

### Author: ![nornagon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/nornagon/32/468_2.png) [@nornagon](https://community.keyboard.io/u/nornagon)
#### Post date: [October 21, 2017, 5:15pm UTC](https://community.keyboard.io/t/fido-u2f-plugin/484/6 "2017-10-21T17:15:44Z")

</div>

Or even upgrade the microcontroller itself to something a little beefier like the [ATmega1284](http://www.microchip.com/wwwproducts/en/ATmega1284) or even an Arduino-compatible ARM device…

---

<div class="post-metadata">

### Author: ![nathanward](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@nathanward](https://community.keyboard.io/u/nathanward)
#### Post date: [March 1, 2018, 10:43am UTC](https://community.keyboard.io/t/fido-u2f-plugin/484/7 "2018-03-01T10:43:29Z")

</div>

Just came across this thread, interesting ideas! What about using the expansion connector, and adding a simple daughterboard with a processor which can handle U2F processing?
