FIDO2
Fast Identity Online 2
An authentication standard enabling passwordless login through hardware security keys or biometrics using public key cryptography.
Détail technique
FIDO2's security rests on the computational difficulty of factoring large semiprimes. Key sizes: 2048-bit is the current minimum, 4096-bit is recommended for long-term security. RSA is ~1000x slower than AES, so it's typically used to encrypt a symmetric session key (hybrid encryption). RSA signing uses the private key; verification uses the public key — the reverse of encryption. OAEP padding (PKCS#1 v2) is required; the older PKCS#1 v1.5 padding has known vulnerabilities (Bleichenbacher's attack).
Exemple
```javascript
// FIDO2 — Web Crypto API example
const data = new TextEncoder().encode('sensitive data');
const hash = await crypto.subtle.digest('SHA-256', data);
const hex = Array.from(new Uint8Array(hash))
.map(b => b.toString(16).padStart(2, '0')).join('');
```