0
$\begingroup$

I am implementing a cryptographic protocol and I'd like to generate a set of seeds using a seed for a pseudo-random function. The reason is that I can pass on only one seed and it can be used to generate the other seeds.

As we know each derived seed is used to generate a set of pseudo-random values.

According to pseudo-random function definition, the seeds must be truly random (and not pseudorandom). So if I use a master seed to generate some other seeds the derived seed would not be truly random (according to the definition).

Question 1: How can I fill the above gap (i.e. satisfy the pseudorandom function) and have a secure key derivation function?

Question 2: Are the key derivation functions deterministic (i.e. given a master key it always generates a set of derived keys)?

$\endgroup$
  • $\begingroup$ You don't need truly random inputs to KDFs. "Highly unpredictable" suffices. As for the KDFs, Argon2 for low-entropy master secrets and HKDF for high entropy master secrets. And yes all KDFs need to be deterministic (or how would the other party derive the same key?), although you can tweak them via salts and sometimes context information. $\endgroup$ – SEJPM Nov 20 '15 at 15:14
  • $\begingroup$ @SEJPM Here is my question, when we feed them with salts, how we would get the same key (with different salt)? Do parties need to exchange salts and master key? $\endgroup$ – user153465 Nov 20 '15 at 15:19
  • $\begingroup$ yes, in this case the parties would secretly exchange master keys (pre-shared? DH?) and then publicly transport salts. $\endgroup$ – SEJPM Nov 20 '15 at 15:25
  • $\begingroup$ @SEJPM Ok thank you. I was gonna use it to reduce communication cost (i.e. instead of sending a set of seeds I could send only one master seed). But , apparently it wont help. $\endgroup$ – user153465 Nov 20 '15 at 15:27
  • $\begingroup$ you could use the context info to derive different keys from one secretely exchanged master key (and just ignore the salt) $\endgroup$ – SEJPM Nov 20 '15 at 15:31
1
$\begingroup$

Do NOT generate your own key derivation function. Use one of the known and trusted ones... industry standard ones, such as PBKDF2 https://en.wikipedia.org/wiki/PBKDF2

Use your starting (pseudo-random) value, and plug it into PBKDF2 for different numbers of iterations for each desired output (new seed) that you need.

$\endgroup$
  • $\begingroup$ Thank you for the answer. I have added one more question. $\endgroup$ – user153465 Nov 20 '15 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.