Openssl ENC Command

Source: Internet
Author: User
Tags base64 encode openssl enc

First, Introduction

ENC-symmetric cryptographic routines, which use symmetric keys to decrypt data, are characterized by fast speed and the ability to process large amounts of data. Algorithm has a stream algorithm and packet encryption algorithm, the stream algorithm is byte-wise, because it is easy to decipher, it is now rarely used; the packet encryption algorithm divides the data into fixed-size groups and then encrypts them in groups, such as DES. There are ecb,cbc,cfb,ofb,ctr and other working modes in the packet algorithm, in which the CBC mode is selected by default.

Second, the grammar

OpenSSL enc-ciphername[-inID]

Options

-inch<file> Inputfile-out <file> Outputfile-pass <arg>Pass phrase source-e Encrypt-D Decrypt-A/-BASE64 Base64 encode/decode, depending on encryption flag-K Passphrase is the next argument-kfile Passphrase is the first line of thefileargument-MD The next argument is the MD-to-use-create a key from a passphrase. See OpenSSL Dgst-H forlist.-S saltinchHex is the next argument-k/-iv Key/ivinchHex is the next argument-[PP] Print the Iv/key ( ThenExitif-P)-bufsize <n>Buffer size-nopad Disable standard block padding-engine e use engine E, possibly a hardware device.

Third, examples

1, using the DES3 algorithm to encrypt the file, and decrypt

OpenSSL enc-p-des3-pass pass:123456 - in
OpenSSL enc-d-des3-pass pass:123456-in cipher.txt-out plain.txt

2, encrypt the data base64 encoding, and before decrypting the data base64 decoding

OpenSSL enc-p-des3-a-pass pass:123456 - in Test.txt--d-des3-a-pass Pass:123456 - in Cipher.txt-out plain.txt

Reference: http://blog.csdn.net/fym0121/article/details/7984733

Openssl ENC Command

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: info-contact@alibabacloud.com 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.