polhenarejos / pico-fido

Transforming a Raspberry Pico into a FIDO Passkey
https://www.picokeys.com
GNU General Public License v3.0
286 stars 39 forks source link

Is it necessary to save the master key? #53

Closed lijicheng168 closed 2 months ago

lijicheng168 commented 2 months ago
Pico FIDO is an open platform, so exercise caution. The flash memory contents can be easily dumped, potentially revealing private/master keys. It is not feasible to encrypt the content, meaning at least one key (the master key) must be stored in clear text.

If the Pico is stolen, the private and secret keys can be accessed.

I think if the master key is not saved, and then each time it is used, the input key is used to decrypt a "master key" into the memory through a symmetric encryption algorithm such as AES, can security be guaranteed? Thanks.

polhenarejos commented 2 months ago

This is how Pico HSM or Pico OpenPGP but FIDO works differently not allowing to input a PIN. The PIN requested by FIDO is not transmitted at any time; instead a hash is provided to the device which is then compared with the one previously stored.

Due to that, I circumvent it by allowing the possibility to transfer the security root to the host (a computer only), which stores a private key used to decipher the master key (we call it “unlock” the master key). However it has important drawbacks:

When you say “input key”, how and when is it transfered to the Pico device?

lijicheng168 commented 2 months ago

Thanks for your explanation.

When you say “input key”, how and when is it transfered to the Pico device?

I make a double check that it's windows will make a PIN to protect something. Not the pico. You still can 'stealing' private keys from Pico. Is there a way that save the private key in encrypt text and you should decrypt it by some 'PIN' then write it to mem for use. As for how to “input key”, maybe use the gpios (even little io but with long length) or transfer it by the hid? That means we can make another procedure that "UNLOCK" the private and secret keys for use when they lose the power. Maybe this can help solve the probelm?

Or maybe consider the RP2350.

polhenarejos commented 2 months ago

Sure, you can even plug a fingerprint. But the purpose of Picokeys is having just a simple board. The code is open so anyone can adapt it to support 3rd party devices.

RP2350 seems a good choice as it can store secret keys OTP. It has been released few days ago and I am seeking how to do it. I’ll receive my RP2350 in a couple of days to start playing.