diafygi / webcrypto-examples

Web Cryptography API Examples Demo: https://diafygi.github.io/webcrypto-examples/
GNU General Public License v2.0
1.64k stars 194 forks source link

Deterministic generation of key pair from seed #35

Open JustinDrake opened 7 years ago

JustinDrake commented 7 years ago

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

JeffreyBPetersen commented 7 years ago

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.

biocrypto730 commented 5 years ago

what the hell