Repository navigation
Conversation
Test Results309 tests +3 306 ✅ +3 5s ⏱️ -1s Results for commit 8e93373. ± Comparison against base commit 40465e6. This pull request skips 1 and un-skips 1 tests. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
11 similar comments
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
|
@mperor ⏰ This daily topic is still waiting for your review. |
What you'll learn
javax.crypto.KDFusing HKDF (extract-then-expand)HKDFParameterSpec.ofExtract().addIKM(...).addSalt(...).thenExpand(info, length)infoparameter binds a derived key to a specific contextderiveKey(alg, spec)(wraps the bytes in aSecretKey) andderiveData(spec)(returns the raw bytes)Why it matters
HKDF lets you turn one shared secret into many independent, purpose-bound keys (e.g. separate keys for encryption vs. authentication) without running extra key-exchange rounds - a pattern used throughout modern protocols like TLS 1.3 and Signal.
Read more
JEP 510: Key Derivation Function API
Quiz
You derive two keys from the same
ikmandsalt, but pass"key-a"as theinfofor the first and"key-b"for the second. Are the two derived keys equal?Answer
No. `info` binds the derived key to its context: even with identical `ikm`/`salt`, a different `info` produces an unrelated key. This is what lets you safely derive several independent keys from one shared secret.Closes #112