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