Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyPair derivation #4

Open
amlord opened this issue Aug 21, 2024 · 3 comments
Open

KeyPair derivation #4

amlord opened this issue Aug 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@amlord
Copy link

amlord commented Aug 21, 2024

Hi @tniessen!

I've just been looking at this package following your comment in the NodeJS repo regarding PQC: https://github.com/orgs/nodejs/discussions/54475

With our use-case, we have a mnemonic phrase, which derives to a seed (64 bytes). I've been reviewing a few different packages over the past week, and came across crystals-kyber-js, which provides a deriveKeyPair method.

Is it possible to achieve something similar with this package? I notice that you can export keys & use this to recover the keypair, but as the mnemonic is the main input for recovery, it'd be great to use this directly.

Kind regards,
Andrew

@tniessen
Copy link
Owner

Thank you for opening an issue @amlord.

I do see the appeal of the feature you are describing, but unfortunately, no such API exists right now, and it is unlikely to be added (unless PQClean decides to do so).

The reason behind this is that derivation of key pairs from seeds is not part of the NIST-defined API for KEMs and hence not officially supported by the reference implementation, nor by PQClean. It is also not part of the newly standardized interface defined in FIPS 203.

Aside from being non-standard, such an API would also be specific to the Kyber KEM, whereas PQClean and this library try to provide a consistent API across KEMs.

That being said, this is not impossible to implement. A similar feature request is PQClean/PQClean#428. We could override the random number generator of the schemes as suggested there to achieve this effect, but it seems like a hacky solution (and PQClean also decided against it for the time being).

@amlord
Copy link
Author

amlord commented Aug 22, 2024

That makes a lot of sense - thanks for the respone :-)

For now, I've used the key derivation in the other lib, and the node-pqclean methods where I can (having benchmarked this, pqclean was orders of magnitue quicker).

@tniessen tniessen added the enhancement New feature or request label Aug 23, 2024
@tniessen
Copy link
Owner

For now, I've used the key derivation in the other lib, and the node-pqclean methods where I can (having benchmarked this, pqclean was orders of magnitue quicker).

@amlord Thank you, it's great to hear that this library performs favorably :)

I'll leave this open as a feature request if you don't mind. If PQClean/PQClean#428 gets resolved, that might help a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants