212 reputation
16
bio website
location
age
visits member for 2 years, 5 months
seen Mar 7 at 7:00

Jan
30
awarded  Yearling
Jan
30
comment Best way to get 32 bytes from PBKDF2
Thanks. I understand the need for the final output to be a single output so that my second option is not so good. But why did you add the salt in the last step? Wouldn't $SHA256(tmp)$ be just as good?
Jan
30
asked How is HKDF-Expand better than a simple hash?
Jan
30
comment Derive both MAC and AES keys from same PBKDF2?
@CodesInChaos But anyway - as I wrote in my comments to my new question - now I don't understand why was HKDF-Expand invented at all (since one can simply use any hash). And also: You can convert your comments to answers, as they have been helpful and deserve upvotes. EDIT Thanks for the previous comment. I'll have to try that now.
Jan
30
comment Derive both MAC and AES keys from same PBKDF2?
@CodesInChaos Thanks. I just now finished writing my own using the specs and am looking for test vectors. But I only wrote the Expand so the test vectors that are available don't help me. Perhaps I'll write the Extract as well. It looks from your code like that's the simple part.
Jan
30
comment Best way to get 32 bytes from PBKDF2
@CodesInChaos Making sure I understand you correctly: your suggestion of using PBKDF2 twice means: feeding the 20 byte output as the "password" for the single iteration run (and reusing the original salt). Is that it? About your second suggestion of simply hashing the result: Now I'm really confused - if it's that simple (since we're not getting any more entropy than our password+salt anyway) - why did they invent HKDF-Expand at all?
Jan
30
comment Best way to get 32 bytes from PBKDF2
@CodesInChaos Thanks. You might as well turn these comments (and to my previous question) into answers so I can upvote them.
Jan
30
revised Best way to get 32 bytes from PBKDF2
edited body
Jan
30
revised Best way to get 32 bytes from PBKDF2
edited body
Jan
30
asked Best way to get 32 bytes from PBKDF2
Jan
29
comment Derive both MAC and AES keys from same PBKDF2?
@CodesInChaos I'm searching it now, but can't seem to find anything less technical than this (or just general descriptions like "is a simple HMAC-based KDF...".
Jan
29
comment Derive both MAC and AES keys from same PBKDF2?
@CodesInChaos Thanks. Is there any .net implementation of HKDF (or better yet, of a well designed password based key derivation functions)?
Jan
29
comment Derive both MAC and AES keys from same PBKDF2?
@CodesInChaos From the second link: PBKDF2 supports the generation of arbitrary amounts of key data. (I'm using Rfc2898DeriveBytes if it matters.)
Jan
29
asked Derive both MAC and AES keys from same PBKDF2?
Dec
13
awarded  Popular Question
May
8
revised What length should the padding be when encrypting or signing with RSA?
deleted 29 characters in body; edited title
May
5
accepted What length should the padding be when encrypting or signing with RSA?
May
5
comment What length should the padding be when encrypting or signing with RSA?
Oh.. and thank you very much for your answer!
May
5
comment What length should the padding be when encrypting or signing with RSA?
@JohnDeters I don't care if two identical messages yield the same output. I'm trying to implement a licensing system. (See my comments to fgrieu's answer and my other recent question on the site .) And I'm mainly concerned with signing.
May
5
comment What length should the padding be when encrypting or signing with RSA?
a) I should calculate a separate padding (is that the term instead of salt?) for each computer (in a random-like manner). And perhaps add a really-random part to it. b) The padding should be at least $256 + (2/3) n$ bits (which, if $n$ is 2048 - would leave me with a maximum of 426 bits (=53 bytes) for the computer-id (or its hash). Did I understand correctly?