I'm trying to generate a bunch of pseudo-random keys for AES using PBKDF2, where the AES ciphers will be used in CTR mode as pseudo-random number generators. My goal is to create a 2-dimensional array, where each entry is a pseudo-random sequence generated by a separate PRNG. The reason for using separate PRNGs is simply because I want each cell to have equal cost to calculate (due to the PBKDF).
So I have two random strings, r1
and r2
(user provided), and I'm generating the AES key for cell (x,y)
as PBKDF2(i || r1, r2 || j)
, where i
and j
are single characters bijectively mapped to x
and y
respectively, and ||
denotes concatenation. I'm using HMAC-SHA256 for the PRF, and nominally 1000 iterations of the PBKDF2. Currently r1 and r2 are 16 bytes each, but I can make them basically any size.
So my questions are:
- Is there any weakness in using such closely related inputs to PBKDF2, in particular when used as AES keys for CTR more?
- Is there any shortcut for calculating the result of the PBKDF2 for different cells that is any faster than having to calculate it from scratch for each cell?
r1
,r2
, and know howi
andj
are generated, granted there's no guess work that needs to be done, but can you generate sayN
cells faster thanN
times however long it takes to run the PBKDF2? Likewise for scrypt? – brianmearns Apr 21 '15 at 00:55