I am written an algorithm to encrypt and decrypt file using AES.
I am also changing the encrypted file extension to .fenc.
So now the problem is that I am not able to detect the content-type of the file because the file is encrypted and extension also changed.
I am planning to do this: in the encrypted file into the first line I will put the content-type details and after that the encrypted data. And while decrypting the file I will read the first line and after that decrypted the content.
What do you think about this?
Why don’t you just add
.fencto the filename, e.g.mymasterplan.ppt.fenc? That way you can determine the content type based on the filename.