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

crypto.createHKDF() #8418

Closed
jorangreef opened this issue Sep 6, 2016 · 7 comments
Closed

crypto.createHKDF() #8418

jorangreef opened this issue Sep 6, 2016 · 7 comments
Labels
crypto Issues and PRs related to the crypto subsystem. feature request Issues that request new features to be added to Node.js.

Comments

@jorangreef
Copy link
Contributor

@indutny would there be any support for adding createHKDF() to the crypto module?

This is useful when doing common crypto work and I have an implementation with test vectors that I can provide.

@bnoordhuis
Copy link
Member

See #8417 (comment). HKDF can be derived from existing crypto methods though.

@bnoordhuis bnoordhuis added crypto Issues and PRs related to the crypto subsystem. feature request Issues that request new features to be added to Node.js. labels Sep 6, 2016
@jorangreef
Copy link
Contributor Author

Thanks, yes. If there is support for adding HKDF to the crypto module, then my thought was to implement it using the existing crypto methods.

The reason for adding it would be that it's a basic crypto primitive, and Node could support it out of the box.

@bnoordhuis
Copy link
Member

If it can be constructed from existing methods it's logically a convenience function, not a primitive. It's not a hard rule but we err on the side of leaving those out.

@jorangreef
Copy link
Contributor Author

HKDF is a cryptographic primitive in the sense that you would not want to decompose it further, write it or invent it yourself (or encourage others to do that). It's a basic standardized crypto building block "primitive", just like HMAC or PBKDF2 are considered cryptographic primitives even though they are themselves implemented using other cryptographic primitives. I think it's fair to say that it's common for people to speak of HMAC and HKDF as cryptographic primitives.

Sure, it's convenient to have HKDF, but it does not follow that HKDF is a convenience function, it's an essential. It's hard to do much crypto without needing HKDF at some point. There's a reason why HKDF was standardized and studied when people could have invented their own HMAC-based key derivation scheme. There is a maintenance cost, but I still think the crypto module deserves HKDF and would be better off for having HKDF than not. If you think otherwise, then I will defer to your opinion and you're welcome to close the issue.

@bnoordhuis
Copy link
Member

/cc @nodejs/crypto in case you missed it.

@indutny
Copy link
Member

indutny commented Sep 16, 2016

I agree with @bnoordhuis , if it can be constructed using existing APIs - there is no need in exposing it.

@jorangreef
Copy link
Contributor Author

Thanks @indutny

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Issues and PRs related to the crypto subsystem. feature request Issues that request new features to be added to Node.js.
Projects
None yet
Development

No branches or pull requests

3 participants