Reference:
(summary) Use tar to decrypt packaged files with OpenSSL encryption
Http://www.ha97.com/5114.html
Decrypting the TAR package with OpenSSL encryption-SA Blog-system Administrator's blog career-it blog
Http://www.cnitblog.com/201/archive/2012/06/06/80901.html
Decrypting a tar package with OpenSSL encryption
Blog_20111015 the folder into a tar package blog_20111015.tar.gz and encrypt
The password is password.
Tar czf–blog_20111015 | OpenSSL des3-salt-k password-out blog_20111015.tar.gz
The encrypted tar package can only be decrypted on Linux and cannot be used on Windows.
Decrypt and unzip the tar package
OpenSSL des3-d-K password-salt-in blog_20111015.tar.gz | Tar Xzf-
Where-K password can not be used, so after executing the command will prompt you to enter, plus the-K parameter can be applied in the program, so that the password can be automatically set.
Examples of usage:
1. Encrypt files using AES-128-CBC algorithm:
openssl enc -aes-128-cbc -in install.log -out enc.log
(Note: Here Install.log is you want to encrypt the file, Enc.log is the encrypted file, enter the system will prompt you to input the password. )
2. Decrypt the file you just encrypted:
openssl enc -d -aes-128-cbc -in enc.log -out install.log
(Note: Enc.log is the file that was just encrypted, Install.log is the decrypted file, and the-D option implements the decryption function.) )
3. After encrypting the file, encode it using BASE64 format:
openssl enc -aes-128-cbc -in install.log -out enc.log -a
4. Use a variety of password input methods to encrypt:
openssl enc -des-ede3-cbc -in install.log -out enc.log -pass pass:111111
(The advantage of this method is that you can write it to the script, automatically complete the encryption function, without using the PASS option the default system will prompt for a password and confirm that it needs to be manually operated.) )
Packet tar Encryption