I have a 128 bit randomly generated key. I need to expand this key to 512 bits to use with an existing encryption library that does AES-256 encryption in CBC mode with HMAC-SHA256 authentication.
The encryption library I am using also has PBKDF2-SHA512 available. Is it acceptable to use PBKDF2 with just 1 iteration to do the simple key expansion that I need? I would also need a salt, for which I suppose I could just use a hardcoded value for.
generated_key = crypto_safe_rand(128) derived_key = pbkdf2(password: generated_key, salt: 'hardcoded_salt', iterations: 1, algorithm: 'SHA-512')
My thought is that the iteration count isn't really a factor since the original "password" is randomly generated and 128 bits long.
Or would it be better to use something like HKDF?