Updated derive_key to be a PBDKF2 (still based on SHA-512) hardcoded with derived-key length of 32 bytes.