diff options
Diffstat (limited to 'secure/usr.bin/openssl/man/enc.1')
-rw-r--r-- | secure/usr.bin/openssl/man/enc.1 | 183 |
1 files changed, 124 insertions, 59 deletions
diff --git a/secure/usr.bin/openssl/man/enc.1 b/secure/usr.bin/openssl/man/enc.1 index aff72b88afa4..a3a27af063ea 100644 --- a/secure/usr.bin/openssl/man/enc.1 +++ b/secure/usr.bin/openssl/man/enc.1 @@ -129,23 +129,25 @@ .\" ======================================================================== .\" .IX Title "ENC 1" -.TH ENC 1 "2018-08-14" "1.0.2p" "OpenSSL" +.TH ENC 1 "2018-09-11" "1.1.1" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" -openssl\-enc, -enc \- symmetric cipher routines +openssl\-enc, enc \- symmetric cipher routines .SH "SYNOPSIS" .IX Header "SYNOPSIS" -\&\fBopenssl enc \-ciphername\fR +\&\fBopenssl enc \-\f(BIcipher\fB\fR +[\fB\-help\fR] +[\fB\-ciphers\fR] [\fB\-in filename\fR] [\fB\-out filename\fR] [\fB\-pass arg\fR] [\fB\-e\fR] [\fB\-d\fR] -[\fB\-a/\-base64\fR] +[\fB\-a\fR] +[\fB\-base64\fR] [\fB\-A\fR] [\fB\-k password\fR] [\fB\-kfile filename\fR] @@ -155,14 +157,20 @@ enc \- symmetric cipher routines [\fB\-salt\fR] [\fB\-nosalt\fR] [\fB\-z\fR] -[\fB\-md\fR] +[\fB\-md digest\fR] +[\fB\-iter count\fR] +[\fB\-pbkdf2\fR] [\fB\-p\fR] [\fB\-P\fR] [\fB\-bufsize number\fR] [\fB\-nopad\fR] [\fB\-debug\fR] [\fB\-none\fR] +[\fB\-rand file...\fR] +[\fB\-writerand file\fR] [\fB\-engine id\fR] +.PP +\&\fBopenssl\fR \fI[cipher]\fR [\fB...\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" The symmetric cipher commands allow data to be encrypted or decrypted @@ -171,90 +179,102 @@ or explicitly provided. Base64 encoding or decoding can also be performed either by itself or in addition to the encryption or decryption. .SH "OPTIONS" .IX Header "OPTIONS" +.IP "\fB\-help\fR" 4 +.IX Item "-help" +Print out a usage message. +.IP "\fB\-ciphers\fR" 4 +.IX Item "-ciphers" +List all supported ciphers. .IP "\fB\-in filename\fR" 4 .IX Item "-in filename" -the input filename, standard input by default. +The input filename, standard input by default. .IP "\fB\-out filename\fR" 4 .IX Item "-out filename" -the output filename, standard output by default. +The output filename, standard output by default. .IP "\fB\-pass arg\fR" 4 .IX Item "-pass arg" -the password source. For more information about the format of \fBarg\fR +The password source. For more information about the format of \fBarg\fR see the \fB\s-1PASS PHRASE ARGUMENTS\s0\fR section in \fIopenssl\fR\|(1). -.IP "\fB\-salt\fR" 4 -.IX Item "-salt" -use a salt in the key derivation routines. This is the default. -.IP "\fB\-nosalt\fR" 4 -.IX Item "-nosalt" -don't use a salt in the key derivation routines. This option \fB\s-1SHOULD NOT\s0\fR be -used except for test purposes or compatibility with ancient versions of OpenSSL -and SSLeay. .IP "\fB\-e\fR" 4 .IX Item "-e" -encrypt the input data: this is the default. +Encrypt the input data: this is the default. .IP "\fB\-d\fR" 4 .IX Item "-d" -decrypt the input data. +Decrypt the input data. .IP "\fB\-a\fR" 4 .IX Item "-a" -base64 process the data. This means that if encryption is taking place +Base64 process the data. This means that if encryption is taking place the data is base64 encoded after encryption. If decryption is set then the input data is base64 decoded before being decrypted. .IP "\fB\-base64\fR" 4 .IX Item "-base64" -same as \fB\-a\fR +Same as \fB\-a\fR .IP "\fB\-A\fR" 4 .IX Item "-A" -if the \fB\-a\fR option is set then base64 process the data on one line. +If the \fB\-a\fR option is set then base64 process the data on one line. .IP "\fB\-k password\fR" 4 .IX Item "-k password" -the password to derive the key from. This is for compatibility with previous +The password to derive the key from. This is for compatibility with previous versions of OpenSSL. Superseded by the \fB\-pass\fR argument. .IP "\fB\-kfile filename\fR" 4 .IX Item "-kfile filename" -read the password to derive the key from the first line of \fBfilename\fR. +Read the password to derive the key from the first line of \fBfilename\fR. This is for compatibility with previous versions of OpenSSL. Superseded by the \fB\-pass\fR argument. +.IP "\fB\-md digest\fR" 4 +.IX Item "-md digest" +Use the specified digest to create the key from the passphrase. +The default algorithm is sha\-256. +.IP "\fB\-iter count\fR" 4 +.IX Item "-iter count" +Use a given number of iterations on the password in deriving the encryption key. +High values increase the time required to brute-force the resulting file. +This option enables the use of \s-1PBKDF2\s0 algorithm to derive the key. +.IP "\fB\-pbkdf2\fR" 4 +.IX Item "-pbkdf2" +Use \s-1PBKDF2\s0 algorithm with default iteration count unless otherwise specified. .IP "\fB\-nosalt\fR" 4 .IX Item "-nosalt" -do not use a salt +Don't use a salt in the key derivation routines. This option \fB\s-1SHOULD NOT\s0\fR be +used except for test purposes or compatibility with ancient versions of +OpenSSL. .IP "\fB\-salt\fR" 4 .IX Item "-salt" -use salt (randomly generated or provide with \fB\-S\fR option) when -encrypting (this is the default). +Use salt (randomly generated or provide with \fB\-S\fR option) when +encrypting, this is the default. .IP "\fB\-S salt\fR" 4 .IX Item "-S salt" -the actual salt to use: this must be represented as a string of hex digits. +The actual salt to use: this must be represented as a string of hex digits. .IP "\fB\-K key\fR" 4 .IX Item "-K key" -the actual key to use: this must be represented as a string comprised only +The actual key to use: this must be represented as a string comprised only of hex digits. If only the key is specified, the \s-1IV\s0 must additionally specified using the \fB\-iv\fR option. When both a key and a password are specified, the key given with the \fB\-K\fR option will be used and the \s-1IV\s0 generated from the -password will be taken. It probably does not make much sense to specify -both key and password. +password will be taken. It does not make much sense to specify both key +and password. .IP "\fB\-iv \s-1IV\s0\fR" 4 .IX Item "-iv IV" -the actual \s-1IV\s0 to use: this must be represented as a string comprised only +The actual \s-1IV\s0 to use: this must be represented as a string comprised only of hex digits. When only the key is specified using the \fB\-K\fR option, the \&\s-1IV\s0 must explicitly be defined. When a password is being specified using one of the other options, the \s-1IV\s0 is generated from this password. .IP "\fB\-p\fR" 4 .IX Item "-p" -print out the key and \s-1IV\s0 used. +Print out the key and \s-1IV\s0 used. .IP "\fB\-P\fR" 4 .IX Item "-P" -print out the key and \s-1IV\s0 used then immediately exit: don't do any encryption +Print out the key and \s-1IV\s0 used then immediately exit: don't do any encryption or decryption. .IP "\fB\-bufsize number\fR" 4 .IX Item "-bufsize number" -set the buffer size for I/O +Set the buffer size for I/O. .IP "\fB\-nopad\fR" 4 .IX Item "-nopad" -disable standard block padding +Disable standard block padding. .IP "\fB\-debug\fR" 4 .IX Item "-debug" -debug the BIOs used for I/O. +Debug the BIOs used for I/O. .IP "\fB\-z\fR" 4 .IX Item "-z" Compress or decompress clear text using zlib before encryption or after @@ -263,28 +283,40 @@ or zlib-dynamic option. .IP "\fB\-none\fR" 4 .IX Item "-none" Use \s-1NULL\s0 cipher (no encryption or decryption of input). +.IP "\fB\-rand file...\fR" 4 +.IX Item "-rand file..." +A file or files containing random data used to seed the random number +generator. +Multiple files can be specified separated by an OS-dependent character. +The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for +all others. +.IP "[\fB\-writerand file\fR]" 4 +.IX Item "[-writerand file]" +Writes random data to the specified \fIfile\fR upon exit. +This can be used with a subsequent \fB\-rand\fR flag. .SH "NOTES" .IX Header "NOTES" -The program can be called either as \fBopenssl ciphername\fR or -\&\fBopenssl enc \-ciphername\fR. But the first form doesn't work with +The program can be called either as \fBopenssl cipher\fR or +\&\fBopenssl enc \-cipher\fR. The first form doesn't work with engine-provided ciphers, because this form is processed before the configuration file is read and any ENGINEs loaded. +Use the \fBlist\fR command to get a list of supported ciphers. .PP -Engines which provide entirely new encryption algorithms (such as ccgost +Engines which provide entirely new encryption algorithms (such as the ccgost engine which provides gost89 algorithm) should be configured in the -configuration file. Engines, specified in the command line using \-engine -options can only be used for hadrware-assisted implementations of -ciphers, which are supported by OpenSSL core or other engine, specified +configuration file. Engines specified on the command line using \-engine +options can only be used for hardware-assisted implementations of +ciphers which are supported by the OpenSSL core or another engine specified in the configuration file. .PP -When enc command lists supported ciphers, ciphers provided by engines, +When the enc command lists supported ciphers, ciphers provided by engines, specified in the configuration files are listed too. .PP A password will be prompted for to derive the key and \s-1IV\s0 if necessary. .PP The \fB\-salt\fR option should \fB\s-1ALWAYS\s0\fR be used if the key is being derived from a password unless you want compatibility with previous versions of -OpenSSL and SSLeay. +OpenSSL. .PP Without the \fB\-salt\fR option it is possible to perform efficient dictionary attacks on the password and to attack stream cipher encrypted data. The reason @@ -295,12 +327,12 @@ encrypting a file and read from the encrypted file when it is decrypted. .PP Some of the ciphers do not have large keys and others have security implications if not used correctly. A beginner is advised to just use -a strong block cipher in \s-1CBC\s0 mode such as bf or des3. +a strong block cipher, such as \s-1AES,\s0 in \s-1CBC\s0 mode. .PP -All the block ciphers normally use PKCS#5 padding also known as standard block -padding: this allows a rudimentary integrity or password check to be -performed. However since the chance of random data passing the test is -better than 1 in 256 it isn't a very good test. +All the block ciphers normally use PKCS#5 padding, also known as standard +block padding. This allows a rudimentary integrity or password check to +be performed. However since the chance of random data passing the test +is better than 1 in 256 it isn't a very good test. .PP If padding is disabled then the input data must be a multiple of the cipher block length. @@ -313,13 +345,27 @@ Blowfish and \s-1RC5\s0 algorithms use a 128 bit key. Note that some of these ciphers can be disabled at compile time and some are available only if an appropriate engine is configured in the configuration file. The output of the \fBenc\fR command run with -unsupported options (for example \fBopenssl enc \-help\fR) includes a -list of ciphers, supported by your versesion of OpenSSL, including +the \fB\-ciphers\fR option (that is \fBopenssl enc \-ciphers\fR) produces a +list of ciphers, supported by your version of OpenSSL, including ones provided by configured engines. .PP The \fBenc\fR program does not support authenticated encryption modes -like \s-1CCM\s0 and \s-1GCM.\s0 The utility does not store or retrieve the -authentication tag. +like \s-1CCM\s0 and \s-1GCM,\s0 and will not support such modes in the future. +The \fBenc\fR interface by necessity must begin streaming output (e.g., +to standard output when \fB\-out\fR is not used before the authentication +tag could be validated, leading to the usage of \fBenc\fR in pipelines +that begin processing untrusted data and are not capable of rolling +back upon authentication failure. The \s-1AEAD\s0 modes currently in common +use also suffer from catastrophic failure of confidentiality and/or +integrity upon reuse of key/iv/nonce, and since \fBenc\fR places the +entire burden of key/iv/nonce management upon the user, the risk of +exposing \s-1AEAD\s0 modes is too great to allow. These key/iv/nonce +management issues also affect other modes currently exposed in \fBenc\fR, +but the failure modes are less extreme in these cases, and the +functionality cannot be removed with a stable release branch. +For bulk encryption of data, whether using authenticated encryption +modes or other modes, \fIcms\fR\|(1) is recommended, as it provides a +standard data format and performs the needed key/iv/nonce management. .PP .Vb 1 \& base64 Base 64 @@ -339,7 +385,7 @@ authentication tag. \& \& des\-cbc DES in CBC mode \& des Alias for des\-cbc -\& des\-cfb DES in CBC mode +\& des\-cfb DES in CFB mode \& des\-ofb DES in OFB mode \& des\-ecb DES in ECB mode \& @@ -357,7 +403,7 @@ authentication tag. \& desx DESX algorithm. \& \& gost89 GOST 28147\-89 in CFB mode (provided by ccgost engine) -\& gost89\-cnt \`GOST 28147\-89 in CNT mode (provided by ccgost engine) +\& gost89\-cnt \`GOST 28147\-89 in CNT mode (provided by ccgost engine) \& \& idea\-cbc IDEA algorithm in CBC mode \& idea same as idea\-cbc @@ -384,12 +430,22 @@ authentication tag. \& rc5\-ofb RC5 cipher in OFB mode \& \& aes\-[128|192|256]\-cbc 128/192/256 bit AES in CBC mode -\& aes\-[128|192|256] Alias for aes\-[128|192|256]\-cbc +\& aes[128|192|256] Alias for aes\-[128|192|256]\-cbc \& aes\-[128|192|256]\-cfb 128/192/256 bit AES in 128 bit CFB mode \& aes\-[128|192|256]\-cfb1 128/192/256 bit AES in 1 bit CFB mode \& aes\-[128|192|256]\-cfb8 128/192/256 bit AES in 8 bit CFB mode +\& aes\-[128|192|256]\-ctr 128/192/256 bit AES in CTR mode \& aes\-[128|192|256]\-ecb 128/192/256 bit AES in ECB mode \& aes\-[128|192|256]\-ofb 128/192/256 bit AES in OFB mode +\& +\& camellia\-[128|192|256]\-cbc 128/192/256 bit Camellia in CBC mode +\& camellia[128|192|256] Alias for camellia\-[128|192|256]\-cbc +\& camellia\-[128|192|256]\-cfb 128/192/256 bit Camellia in 128 bit CFB mode +\& camellia\-[128|192|256]\-cfb1 128/192/256 bit Camellia in 1 bit CFB mode +\& camellia\-[128|192|256]\-cfb8 128/192/256 bit Camellia in 8 bit CFB mode +\& camellia\-[128|192|256]\-ctr 128/192/256 bit Camellia in CTR mode +\& camellia\-[128|192|256]\-ecb 128/192/256 bit Camellia in ECB mode +\& camellia\-[128|192|256]\-ofb 128/192/256 bit Camellia in OFB mode .Ve .SH "EXAMPLES" .IX Header "EXAMPLES" @@ -439,8 +495,17 @@ Decrypt some data using a supplied 40 bit \s-1RC4\s0 key: .IX Header "BUGS" The \fB\-A\fR option when used with large files doesn't work properly. .PP -There should be an option to allow an iteration count to be included. -.PP The \fBenc\fR program only supports a fixed number of algorithms with certain parameters. So if, for example, you want to use \s-1RC2\s0 with a 76 bit key or \s-1RC4\s0 with an 84 bit key you can't use this program. +.SH "HISTORY" +.IX Header "HISTORY" +The default digest was changed from \s-1MD5\s0 to \s-1SHA256\s0 in Openssl 1.1.0. +.SH "COPYRIGHT" +.IX Header "COPYRIGHT" +Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved. +.PP +Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file \s-1LICENSE\s0 in the source distribution or at +<https://www.openssl.org/source/license.html>. |