I'm developing a simple utility to solve a very specific issue: I want to store all my pictures on cloud. Family pictures, nothing kinky, illegal or death-threatening. the requirements are:
I want them to be at least "obscured", as in "not automatically viewable and indexable when someone sweeps my storage account", like Google or Microsoft when they're collecting stuff to train their cognitive services or any corporation mega.co.nz gives access to my files to. Better would be securely encrypted, obviously.
I need to be able to detect changes to a single image and upload only that, thus avoiding huge archives.
I have developed a sequence of operation using only standard libraries (apache commons crypto mainly) that should be secure by current standards:
[one time, when running the encryption]
- input a password (any length)
[next steps are repeated for each file]
- generate a secureRandom salt (32 bytes)
- compute a 16 byte password+salt hash using PBKDF2WithHmacSHA512 (1000 iterations)
- generate a secureRandom IV (16 bytes)
- ZIP the single file (this is toggleable as it's useless for images)
- AES encrypt the file using AES/CBC/PKCS7Padding
I know that this will not conceal the name, nature and size of my files, (contrary to what Cryptomator tries to do, for example, but webdav is a pain when trying to detect file changes), but that should be fine by me unless it enables cracking of the whole encryption somehow.
Now I need to store the salt and the IV, and currently I have decided to store them in a metadata JSON file in the same place where I will store the encrypted file. I have read and understood that the IV must be random but doesn't need to be secret, correct me if I'm wrong, but what about the hash salt? Can I store it with the IV and the encrypted file without threatening any part of the encryption?