Some authenticators (e.g., Windows Hello) consider `new ArrayBuffer(0)` to be invalid, others (e.g., 1Password) consider it to be valid. Setting `id` to a non-zero value enables wider compatibility.
Ardis Lu [Wed, 23 Jul 2025 04:18:51 +0000 (21:18 -0700)]
Pad plaintext bytes so the encoded ciphertext has no base64 padding
Since base64 padding is ignored on decode, the padding can be deleted or replaced with junk data. As a result, it is possible to decode different strings into the same bytes. By padding the bytes so the bytes are a multiple of 3, there is never base64 padding and exactly one input yields the desired output.
Ardis Lu [Mon, 21 Jul 2025 03:47:34 +0000 (20:47 -0700)]
Remove challenge
Challenge does not make sense in this context because both passkey creation and retrieval are entirely client-side.
The signed challenge is also not verified, and so challenge is actually unused and could be replaced by any junk value in the output content without affecting the decryption.