Using Java, I wrote a piece of code that encrypts a given file with AES in GCM mode of operation. So far nothing uncommon.
Now I would also like to encrypt the filename, in the following way:
encrypted filename <- AES(key, IV, original filename).
In order to avoid having multiple key:IV pairs, I also encrypt data with the same key and nonce, like so:
encrypted file <- AES(key, IV, original file)
I know that reusing a key:IV pair is strictly forbidden when dealing with stream ciphers, but since the filename and the file are both in the same set of data, my guess is that it should be fine. However, I am not sure.
Anyone can confirm this ?
tl;dr is it OK to encrypt both a file and the filename with the same key:IV pair with GCM ?