Skip to content

Salt in KDF #10

Answered by samuel-lucas6
shipitfaster asked this question in Q&A
Apr 2, 2023 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

I've moved it to a discussion.

Because an ephemeral key pair is being used, you don't really need a salt here. A salt is primarily needed for either a) deriving multiple subkeys from the same master key (e.g. a counter salt), b) randomness extraction in HKDF when deriving keys from a shared secret, or c) because you want to ensure a unique output despite the same input (e.g. static long-term key pairs, so a random salt).

You can just specify an all-zero salt, but I would recommend specifying a personalisation (e.g. Encoding.UTF8.GetBytes("application name")) for domain separation to your application as it's good practice.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@shipitfaster
Comment options

@samuel-lucas6
Comment options

@shipitfaster
Comment options

@samuel-lucas6
Comment options

Answer selected by samuel-lucas6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #9 on April 03, 2023 20:01.