3

I'm trying to encrypt a file as well as its filename. Encrypting the file is fairly easy, I use gpg for that, but I can't figure out how to encrypt the filename as well. Would be great if the filename could be encrypted using the same key.

Any idea on how to do this?

Weekender
  • 31
  • 3

2 Answers2

2

ecryptfs.org

ecryptfs can encrypt both the file contents and the file names. It's the default home directory encryption scheme supported by Ubuntu.

Luke Quinane
  • 717
  • 1
  • 9
  • 20
1

If you are already using gpg, I would advise you the following process:

  1. Create a directory with a meaningless name (eg. use mktemp -d).

  2. Copy your file(s) into this directory.

  3. Encrypt and compress the archive of this directory with gpg:

    gpg-zip -c -o file.gpg dirname
    

You may want to write a shell script to automate this easily.

perror
  • 351
  • 1
  • 6
  • 18