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

Add doc for 'label' and 'context' params in HKDF #56

Open patrickfav opened 6 years ago

patrickfav commented 6 years ago

These are according to the HKDF spec: https://tools.ietf.org/html/rfc5869

There is a extract and a expand phase. The salt (aka label) is used in the extract phase:

HKDF-Extract(salt, IKM) -> PRK
salt     optional salt value (a non-secret random value);
         if not provided, it is set to a string of HashLen zeros.

and the info (aka context) is used in the expand phase:

HKDF-Expand(PRK, info, L) -> OKM
info     optional context and application specific information
         (can be a zero-length string)
patrickfav commented 5 years ago

Any chance this will be merged?

LiraNuna commented 5 years ago

Please note that salt and info are required as per webcrypto spec: https://www.w3.org/TR/WebCryptoAPI/#hkdf-params

In addition, HKDF-CRT was replaced with HKDF, and I already addressed it with https://github.com/diafygi/webcrypto-examples/pull/54

patrickfav commented 5 years ago

Thanks for the heads up. Thats interesting as the the RFC defines it as optional. Your PR is probably better then. Unfortunately it seems the maintainer has no interest in merging these PRs anytime soon.