Simple encrypt and decrypt folder

bigart

Member

Reaction score: 1
Messages: 52

Hi,
I have test directory with one file inside test.txt and I want to encrypt it and compress

Encrypt and compress command below:

tar cfz - test | openssl enc -aes-256-cbc -a -k test -salt > test.tar.gz

It's creating file but i can't decrypt it.
How unpack it in one command ?
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator
Developer

Reaction score: 3,182
Messages: 11,426

In other words, you forgot '-e' and maybe the counterpart '-d'.
 
OP
B

bigart

Member

Reaction score: 1
Messages: 52

encrypt:
tar cfz - test | openssl enc -aes-256-cbc -e -a -k test -salt > test.tar.gz

decrypt:
openssl enc -d -aes-256-cbc -a -k test -in test.tar.gz | tar zxf -

decrypt to folder
openssl enc -d -aes-256-cbc -a -k test -in test.tar.gz | tar zxf - -C test2

decrypt to folder and remove the specified number of leading path
openssl enc -d -aes-256-cbc -a -k test -in test.tar.gz | tar vzxf - -C test2 --strip-components 1
 
Top