[ Team LiB ] |
Recipe 7.18 Encrypting Directories7.18.1 ProblemYou want to encrypt an entire directory tree. 7.18.2 SolutionTo produce a single encrypted file containing all files in the directory, with symmetric encryption: $ tar cf - name_of_directory | gpg -c > files.tar.gpg or key-based encryption: $ tar cf - name_of_directory | gpg -e > files.tar.gpg To encrypt each file separately: $ find name_of_directory -type f -exec gpg -e '{}' \; 7.18.3 DiscussionNotice the find method uses public-key encryption, not symmetric. If you need a symmetric cipher [Recipe 7.4] or to sign the files [Recipe 7.13], avoid this method, as you'd be prompted for your password/passphrase for each file processed. 7.18.4 See Alsogpg(1), find(1), tar(1). |
[ Team LiB ] |