diafygi/webcrypto-examples

Deterministic generation of key pair from seed

JustinDrake opened this issue · 2 comments

Does webcrypto allow for the deterministic generation of RSA key pairs from a seed?

Doesn't look like it does unfortunately.

My interpretation of https://w3c.github.io/webcrypto/Overview.html is that:

  1. deriveKey requires the target key type to support "get key length" which isn't supported by any of the RSA options (which AFAIK is because an extra step would be needed to derive values suitable for RSA as opposed to the symmetric algorithms that do support "get key length").
  2. generateKey lacks any options for providing a seed value either directly or by separately seeding its source of random numbers.

Maybe check out https://github.com/wwwtyro/cryptico for a specific example of what you're describing and https://github.com/bitwiseshiftleft/sjcl if you want a better vetted suite of cryptographic operations? I'd also be happy to know any potentially better solutions if anyone has one.

what the hell