Packet tar Encryption

Source: Internet
Author: User
Tags openssl enc


(summary) Use tar to decrypt packaged files with OpenSSL encryption

Decrypting the TAR package with OpenSSL encryption-SA Blog-system Administrator's blog career-it blog

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.