mauro wrote:
If I understand correctly the gist of how U2F works, then when enrolling a new credential a public/private key pair is generated, the public part is sent to the website and the private part along with some other information is stored in the secure element. For practical purposes the storage in the secure element might be able to store more credentials than one might ever need but I'm still curious about how many it can store.
Yubico got clever about keypair generation. The U2F internals create a site's private key from a hash of the appID sent by each site, a locally generated-at-registration random nonce and the unique U2F secret (only one per U2F key). They generate the public key from the private key and return that public key, but also return the nonce and a generated MAC as the keyhandle. The private key is then discarded!
The sites themselves store the public key and nonce (the latter as part of the keyhandle). When transacting, the nonce and MAC are returned to the U2F key (again that's the keyhandle) as is the appID. The private key is then internally re-generated from hash of the appid/nonce (and unique U2F secret) each time.
So the U2F key doesn't store *anything* about each site.
It sounds really backwards, but it works.
See here:
https://developers.yubico.com/U2F/Proto ... ation.htmlBrendan