Encryting both file contents and file name with GnuPG

Neil Phillips neil.phillips39 at gmail.com
Sun Jan 2 18:13:28 CET 2011

Atom Smasher <atom <at> smasher.org> writes:

> 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 
> hashing...
>   SHA1 ("secret-1.txt:secret") = df3d0b4eb1034f7392c60baec6137c62a2d4579a
>   SHA1 ("secret-2.txt:secret") = 39238faa73f2472e253d5f096b28c8b31c8e8a00
>   SHA1 ("secret-3.txt:secret") = 9450a1f9cd93a47c8d3621cb7fc3ca0ec1df47b7

aha that sounds like a plan.

gpg should be able to give a hash, something like;
gpg -output sha1("a filename") -e filename

i'll give it a tryout tomorrow.

More information about the Gnupg-users mailing list