Encrypting file names?

Discussion related to AES Crypt, the file encryption software for Windows, Linux, Mac, and Java.
Post Reply
s.sec
Posts: 14
Joined: Tue Jun 25, 2013 11:12 am

Encrypting file names?

Post by s.sec » Sat Feb 08, 2014 2:42 am

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!

User avatar
paulej
Posts: 521
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Encrypting file names?

Post by paulej » Sat Feb 08, 2014 5:28 am

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.

User avatar
barefootNH
Posts: 12
Joined: Mon Sep 09, 2013 7:25 pm
Location: New Hampshire
Contact:

Re: Encrypting file names?

Post by barefootNH » Sun Feb 09, 2014 5:53 pm

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.

User avatar
paulej
Posts: 521
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Encrypting file names?

Post by paulej » Sun Feb 09, 2014 6:29 pm

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.

User avatar
Crypto-256
Posts: 7
Joined: Sun Dec 16, 2012 2:56 pm

Re: Encrypting file names?

Post by Crypto-256 » Tue May 27, 2014 1:28 pm

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.

BlackCat
Posts: 1
Joined: Tue Feb 02, 2016 2:49 am

Re: Encrypting file names?

Post by BlackCat » Tue Feb 02, 2016 3:02 am

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.

Post Reply