Assume an "encrypted data package" file format which includes the following data
PBKDF2
- algorithm
- salt
- rounds
- keylen
AES
- algorithm & mode
- IV
- ciphertext
where the PBKDF2 salt and AES IV are generated using a CSPRNG upon individual encryption.
This would make the individual password (used as PBKDF2 input parameter) the only seperately stored data (secret to the "encrypted data package" file) which is stored in a secure place.
Is it safe to store both the AES-related data and the PBKDF2-related data (except passwords) in one file, or are there any cryptographic implications when doing so? If there are implications, what would be the advantages (from a security point of view) of storing the PBKDF2 data separately from the AES data?
When describing potential pitfalls, it would be nice when answers would assume and expand on the following two scenarios:
- AES-256-CTR, with the PBKDF2 parameters simply prepended to the ciphertext, and
- AES-256-GCM, with the PBKDF2 parameters fed into the AES mode as associated data.
Think of this more as a canonical question, hinting at
- *“Do seperate storages resemble security by obfuscation?” and
- ”What's the minimum data we would need to store in a secure location, and what other data can we safely store next to the ciphertext 'out in the open' so that we don’t introduce cryptographical problems?”