Page 1 of 1

Encrypting file names?

Posted: Sat Feb 08, 2014 2:42 am
by s.sec
Hi, I wonder if you have ever considered encrypting file names using the same password and algo that is used to encrypt the file content. Would that be feasible?
A file file.txt could become ae88a00ffcccdaae88a00ffcccda.aes and the file name would be decrypted together with the file content?
thanks!

Re: Encrypting file names?

Posted: Sat Feb 08, 2014 5:28 am
by paulej
The file name would have to be very long. To provide protection against several kinds of attacks, there would need to be a 16 byte initialization vector and file names would follow, with padding to 16 octets. Then the binary would need to be converted to ASCII.

Doable, but in the worst case, a file named "a" would end up being 64 bytes long. It could be made shorter using Base64 encoding or similar, but still not friendly.

I don't personally think it's worth it.

What might be interesting is if the plaintext file name is encrypted as a part of the file itself. However, this would cause confusion for casual users. The simplest solution is to just name files using something cryptic if that's important. Zipping files and encrypting the zip file is also a way to solve the problem.

Re: Encrypting file names?

Posted: Sun Feb 09, 2014 5:53 pm
by barefootNH
I've also thought about this feature. AxCrypt and the venerable BlowfishAdvanced has this feature: I think their encrypted filenames are 8 characters long. I have no idea how they do it or how secure it is.

Re: Encrypting file names?

Posted: Sun Feb 09, 2014 6:29 pm
by paulej
I don't know. With names that short, I'd guess the real filename is encrypted inside the file and only some random name is used for the encrypted file.

Re: Encrypting file names?

Posted: Tue May 27, 2014 1:28 pm
by Crypto-256
About Blowfish advanced, I think you are right, they save the real file name inside and give just some kind of random name to the encrypted file, which is short.

AESCrypt does not encrypt filenames, which has some pros and cons
The advantage is that when I see a file like "Business plan 2012.pdf.aes" I know what kind of file this is and what it is about. So I unencrypt only that file.
If I would look in a folder with over 100 encrypted files and every one would be named like "3a98fd9fda.aes" , well then I would have to unencrypt ALL files inside that folder and then look in the unencrypted files for my "Business plan 2012.pdf" which I just need and delete all the other needlessly unencrypted files

Sure, having the filename in clear has also the disadvantage that even when the file is encrypted , everybody sees what is the file about.
So as Paulej suggested, if the filename should stay a secret, you can ZIP the file before, rename it to something cryptic and then encrypt it with AESCrypt. That is also how you can encrypt whole folders, just ZIP the whole folder, then encrypt that Zip-file with AESCrypt, because AESCrypt does not support folder-encryption by itself.

Re: Encrypting file names?

Posted: Tue Feb 02, 2016 3:02 am
by BlackCat
I also would love to see this added as an option. Encrypting the filename with the same key and replacing it with a sensible length random string. Simple.

On windows you can do the whole job with 7zip and a .7z archive for multiple or single files except automatically generate the new file name.