Article 58B0B [SOLVED] Batch encrypting files with mcrypt

[SOLVED] Batch encrypting files with mcrypt

by
taylorkh
from LinuxQuestions.org on (#58B0B)
My project for this morning is to encrypt a bunch of files which I wish to backup to a cloud drive service. I am playing with mcrypt which I think will do the trick. Code:ken@vmMintMate19:~/Desktop$ mcrypt -f keyfile.txt ./crypt/*
File ./crypt/bookmarks_7_8_20.html was encrypted.
File ./crypt/goodservers was encrypted.
File ./crypt/Sample Ballot.pdf was encrypted.
File ./crypt/vpn_functions.sh was encrypted.However, my real data is in a somewhat deep directory tree. So I will be using a find and exec approach. This does not seem to workCode:ken@vmMintMate19:~/Desktop$ find ./crypt -type f -exec mcrypt -k keyfile.txt {} \;
Warning: It is insecure to specify keywords in the command line
mcrypt: Encrypted data will not be written to a terminal.
Redirect the output instead.
Use the --help parameter for more help.
<snip> a bunch more of the same messageI think my find/exec is OKCode:ken@vmMintMate19:~/Desktop$ find ./crypt -type f -exec ls -l {} \;
-rw------- 1 ken ken 41570 Jul 8 15:03 ./crypt/bookmarks_7_8_20.html
-rw------- 1 ken ken 215 Sep 11 14:47 ./crypt/goodservers
-rw------- 1 ken ken 93162 Sep 17 08:58 './crypt/Sample Ballot.pdf'
-rw------- 1 ken ken 8845 Sep 11 15:54 ./crypt/vpn_functions.shWhat am I missing?

TIA,

Ken
p.s. Yes, writing the pass phrase to a file is bad etc. However, all file systems on my workstation are encrypted with LUKS/dmcrypt and I can shred it later. I may also try storing the passphrase to the appropriate memory variable when I do the run for real.latest?d=yIl2AUoC8zA latest?i=d2Z0MS3S1TQ:NgJDk4TZh9Q:F7zBnMy latest?i=d2Z0MS3S1TQ:NgJDk4TZh9Q:V_sGLiP latest?d=qj6IDK7rITs latest?i=d2Z0MS3S1TQ:NgJDk4TZh9Q:gIN9vFwd2Z0MS3S1TQ
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments