Encryting both file contents and file name with GnuPG

Atom Smasher atom at smasher.org
Sun Jan 2 16:35:18 CET 2011

On Sun, 2 Jan 2011, Neil Phillips wrote:

> i was hoping to do the following;
> locate a source file.
> place the name of the source file in a log.
> encrypt the source file name and contents
> add to the log the name of the encrypted file.
> that way i have a list which tells me what the real name of the file is. 
> i can use the log to pick which file i want to decrypt.

just hash the file-name.

  SHA1 ("secret-1.txt") = d422b71f32b06168db114638fa9778c42d7d0f3c
  SHA1 ("secret-2.txt") = d0ab019ba1975dab7c100bc5b4efa020bcd86a5d
  SHA1 ("secret-3.txt") = 753b2bd68f7ff5fc44f9142245039375a3a5b2f8

use the hash as the encrypted file name. feel free to add a dot-suffix.

keep that reference in a db or text file and you can recover the original 
filename easily.

if you're concerned that the name and/or format of the original file names 
are too predictable, concatenate the filename with a "secret" before 
  SHA1 ("secret-1.txt:secret") = df3d0b4eb1034f7392c60baec6137c62a2d4579a
  SHA1 ("secret-2.txt:secret") = 39238faa73f2472e253d5f096b28c8b31c8e8a00
  SHA1 ("secret-3.txt:secret") = 9450a1f9cd93a47c8d3621cb7fc3ca0ec1df47b7


  762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808

 	"Sometimes I think we're alone in the universe,
 	 and sometimes I think we're not.
 	 In either case the idea is quite staggering."
 		-- Arthur C. Clarke

More information about the Gnupg-users mailing list