I have an encryption scheme that uses a 256-bit master key, from which 2 separate keys (one for AES-256-CTR encryption and one for a HMAC-SHA256) are derived using HKDF. However, I'm not sure exactly how to utilize HKDF without screwing it up, so straight to my concerns:
- Is it safe to just use SHA-512 as the hashing algorithm to get a 512-bit output and split it in 2?
- I know that using salt is not mandatory, but does using it actually improve security?
- I know this might be a dumb idea, but still ... can the salt be the IV used for encryption?