summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjmc <>2016-08-12 06:17:22 +0000
committerjmc <>2016-08-12 06:17:22 +0000
commit9be0af43f3f62117686b801f9966a92c98be3bc3 (patch)
tree4cde8a0d98e808ad2a6927e94a1c79b74f82b015 /src
parentcd136ec7c1c72f19ec727ffd658d119cdae75afe (diff)
downloadopenbsd-9be0af43f3f62117686b801f9966a92c98be3bc3.tar.gz
openbsd-9be0af43f3f62117686b801f9966a92c98be3bc3.tar.bz2
openbsd-9be0af43f3f62117686b801f9966a92c98be3bc3.zip
shorten openssl enc, with help from jsing;
ok jsing beck
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/openssl.1240
1 files changed, 39 insertions, 201 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1
index 3ff441a59f..696ee2f245 100644
--- a/src/usr.bin/openssl/openssl.1
+++ b/src/usr.bin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.48 2016/08/10 17:41:08 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.49 2016/08/12 06:17:22 jmc Exp $
2.\" ==================================================================== 2.\" ====================================================================
3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4.\" 4.\"
@@ -112,7 +112,7 @@
112.\" 112.\"
113.\" OPENSSL 113.\" OPENSSL
114.\" 114.\"
115.Dd $Mdocdate: August 10 2016 $ 115.Dd $Mdocdate: August 12 2016 $
116.Dt OPENSSL 1 116.Dt OPENSSL 1
117.Os 117.Os
118.Sh NAME 118.Sh NAME
@@ -1666,13 +1666,9 @@ is currently not implemented.
1666.It Fl text 1666.It Fl text
1667Print the EC parameters in human readable form. 1667Print the EC parameters in human readable form.
1668.El 1668.El
1669.\"
1670.\" ENC
1671.\"
1672.Sh ENC 1669.Sh ENC
1673.nr nS 1 1670.nr nS 1
1674.Nm "openssl enc" 1671.Nm "openssl enc"
1675.Bk -words
1676.Fl ciphername 1672.Fl ciphername
1677.Op Fl AadePp 1673.Op Fl AadePp
1678.Op Fl base64 1674.Op Fl base64
@@ -1691,7 +1687,6 @@ Print the EC parameters in human readable form.
1691.Op Fl pass Ar arg 1687.Op Fl pass Ar arg
1692.Op Fl S Ar salt 1688.Op Fl S Ar salt
1693.Op Fl salt 1689.Op Fl salt
1694.Ek
1695.nr nS 0 1690.nr nS 0
1696.Pp 1691.Pp
1697The symmetric cipher commands allow data to be encrypted or decrypted 1692The symmetric cipher commands allow data to be encrypted or decrypted
@@ -1699,6 +1694,17 @@ using various block and stream ciphers using keys based on passwords
1699or explicitly provided. 1694or explicitly provided.
1700Base64 encoding or decoding can also be performed either by itself 1695Base64 encoding or decoding can also be performed either by itself
1701or in addition to the encryption or decryption. 1696or in addition to the encryption or decryption.
1697The program can be called either as
1698.Nm openssl Ar ciphername
1699or
1700.Nm openssl enc - Ns Ar ciphername .
1701.Pp
1702Some of the ciphers do not have large keys and others have security
1703implications if not used correctly.
1704All the block ciphers normally use PKCS#5 padding,
1705also known as standard block padding.
1706If padding is disabled, the input data must be a multiple of the cipher
1707block length.
1702.Pp 1708.Pp
1703The options are as follows: 1709The options are as follows:
1704.Bl -tag -width Ds 1710.Bl -tag -width Ds
@@ -1710,7 +1716,7 @@ option is set, then base64 process the data on one line.
1710Base64 process the data. 1716Base64 process the data.
1711This means that if encryption is taking place, the data is base64-encoded 1717This means that if encryption is taking place, the data is base64-encoded
1712after encryption. 1718after encryption.
1713If decryption is set, the input data is base64 decoded before 1719If decryption is set, the input data is base64-decoded before
1714being decrypted. 1720being decrypted.
1715.It Fl bufsize Ar number 1721.It Fl bufsize Ar number
1716Set the buffer size for I/O. 1722Set the buffer size for I/O.
@@ -1719,11 +1725,11 @@ Decrypt the input data.
1719.It Fl debug 1725.It Fl debug
1720Debug the BIOs used for I/O. 1726Debug the BIOs used for I/O.
1721.It Fl e 1727.It Fl e
1722Encrypt the input data: this is the default. 1728Encrypt the input data.
1729This is the default.
1723.It Fl in Ar file 1730.It Fl in Ar file
1724The input 1731The input file to read from,
1725.Ar file ; 1732or standard input if none is specified.
1726standard input by default.
1727.It Fl iv Ar IV 1733.It Fl iv Ar IV
1728The actual 1734The actual
1729.Ar IV 1735.Ar IV
@@ -1734,21 +1740,17 @@ When only the
1734.Ar key 1740.Ar key
1735is specified using the 1741is specified using the
1736.Fl K 1742.Fl K
1737option, the 1743option,
1738.Ar IV 1744the IV must explicitly be defined.
1739must explicitly be defined.
1740When a password is being specified using one of the other options, 1745When a password is being specified using one of the other options,
1741the 1746the IV is generated from this password.
1742.Ar IV
1743is generated from this password.
1744.It Fl K Ar key 1747.It Fl K Ar key
1745The actual 1748The actual
1746.Ar key 1749.Ar key
1747to use: 1750to use:
1748this must be represented as a string comprised only of hex digits. 1751this must be represented as a string comprised only of hex digits.
1749If only the key is specified, the 1752If only the key is specified,
1750.Ar IV 1753the IV must also be specified using the
1751must be additionally specified using the
1752.Fl iv 1754.Fl iv
1753option. 1755option.
1754When both a 1756When both a
@@ -1759,9 +1761,7 @@ are specified, the
1759.Ar key 1761.Ar key
1760given with the 1762given with the
1761.Fl K 1763.Fl K
1762option will be used and the 1764option will be used and the IV generated from the password will be taken.
1763.Ar IV
1764generated from the password will be taken.
1765It probably does not make much sense to specify both 1765It probably does not make much sense to specify both
1766.Ar key 1766.Ar key
1767and 1767and
@@ -1770,16 +1770,12 @@ and
1770The 1770The
1771.Ar password 1771.Ar password
1772to derive the key from. 1772to derive the key from.
1773This is for compatibility with previous versions of
1774.Nm OpenSSL .
1775Superseded by the 1773Superseded by the
1776.Fl pass 1774.Fl pass
1777option. 1775option.
1778.It Fl kfile Ar file 1776.It Fl kfile Ar file
1779Read the password to derive the key from the first line of 1777Read the password to derive the key from the first line of
1780.Ar file . 1778.Ar file .
1781This is for compatibility with previous versions of
1782.Nm OpenSSL .
1783Superseded by the 1779Superseded by the
1784.Fl pass 1780.Fl pass
1785option. 1781option.
@@ -1789,43 +1785,28 @@ Use
1789to create a key from a pass phrase. 1785to create a key from a pass phrase.
1790.Ar digest 1786.Ar digest
1791may be one of 1787may be one of
1792.Dq md5 1788.Cm md5
1793or 1789or
1794.Dq sha1 . 1790.Cm sha1 .
1795.It Fl none 1791.It Fl none
1796Use NULL cipher (no encryption or decryption of input). 1792Use NULL cipher (no encryption or decryption of input).
1797.It Fl nopad 1793.It Fl nopad
1798Disable standard block padding. 1794Disable standard block padding.
1799.It Fl nosalt 1795.It Fl nosalt
1800Don't use a 1796Don't use a salt in the key derivation routines.
1801.Ar salt
1802in the key derivation routines.
1803This option should 1797This option should
1804.Em NEVER 1798.Em NEVER
1805be used unless compatibility with previous versions of 1799be used
1806.Nm OpenSSL 1800since it makes it possible to perform efficient dictionary
1807or 1801attacks on the password and to attack stream cipher encrypted data.
1808.Nm SSLeay
1809is required.
1810.It Fl out Ar file 1802.It Fl out Ar file
1811The output 1803The output file to read from,
1812.Ar file , 1804or standard output if none is specified.
1813standard output by default.
1814.It Fl P 1805.It Fl P
1815Print out the 1806Print out the salt, key, and IV used, then immediately exit;
1816.Ar salt ,
1817.Ar key ,
1818and
1819.Ar IV
1820used, then immediately exit;
1821don't do any encryption or decryption. 1807don't do any encryption or decryption.
1822.It Fl p 1808.It Fl p
1823Print out the 1809Print out the salt, key, and IV used.
1824.Ar salt ,
1825.Ar key ,
1826and
1827.Ar IV
1828used.
1829.It Fl pass Ar arg 1810.It Fl pass Ar arg
1830The password source. 1811The password source.
1831.It Fl S Ar salt 1812.It Fl S Ar salt
@@ -1834,155 +1815,12 @@ The actual
1834to use: 1815to use:
1835this must be represented as a string comprised only of hex digits. 1816this must be represented as a string comprised only of hex digits.
1836.It Fl salt 1817.It Fl salt
1837Use a 1818Use a salt in the key derivation routines (the default).
1838.Ar salt 1819When the salt is being used
1839in the key derivation routines. 1820the first eight bytes of the encrypted data are reserved for the salt:
1840This is the default. 1821it is randomly generated when encrypting a file and read from the
1841.El
1842.Sh ENC NOTES
1843The program can be called either as
1844.Nm openssl ciphername
1845or
1846.Nm openssl enc -ciphername .
1847.Pp
1848A password will be prompted for to derive the
1849.Ar key
1850and
1851.Ar IV
1852if necessary.
1853.Pp
1854The
1855.Fl nosalt
1856option should
1857.Em NEVER
1858be used unless compatibility with previous versions of
1859.Nm OpenSSL
1860or
1861.Nm SSLeay
1862is required.
1863.Pp
1864With the
1865.Fl nosalt
1866option it is possible to perform efficient dictionary
1867attacks on the password and to attack stream cipher encrypted data.
1868The reason for this is that without the salt
1869the same password always generates the same encryption key.
1870When the salt
1871is being used the first eight bytes of the encrypted data are reserved
1872for the salt:
1873it is generated at random when encrypting a file and read from the
1874encrypted file when it is decrypted. 1822encrypted file when it is decrypted.
1875.Pp 1823.El
1876Some of the ciphers do not have large keys and others have security
1877implications if not used correctly.
1878A beginner is advised to just use a strong block cipher in CBC mode
1879such as bf or des3.
1880.Pp
1881All the block ciphers normally use PKCS#5 padding also known as standard block
1882padding:
1883this allows a rudimentary integrity or password check to be performed.
1884However, since the chance of random data passing the test is
1885better than 1 in 256, it isn't a very good test.
1886.Pp
1887If padding is disabled, the input data must be a multiple of the cipher
1888block length.
1889.Pp
1890All RC2 ciphers have the same key and effective key length.
1891.Pp
1892Blowfish and RC5 algorithms use a 128-bit key.
1893.Sh ENC SUPPORTED CIPHERS
1894.Bd -unfilled -offset indent
1895aes-[128|192|256]-cbc 128/192/256 bit AES in CBC mode
1896aes-[128|192|256] Alias for aes-[128|192|256]-cbc
1897aes-[128|192|256]-cfb 128/192/256 bit AES in 128 bit CFB mode
1898aes-[128|192|256]-cfb1 128/192/256 bit AES in 1 bit CFB mode
1899aes-[128|192|256]-cfb8 128/192/256 bit AES in 8 bit CFB mode
1900aes-[128|192|256]-ecb 128/192/256 bit AES in ECB mode
1901aes-[128|192|256]-ofb 128/192/256 bit AES in OFB mode
1902
1903base64 Base 64
1904
1905bf Alias for bf-cbc
1906bf-cbc Blowfish in CBC mode
1907bf-cfb Blowfish in CFB mode
1908bf-ecb Blowfish in ECB mode
1909bf-ofb Blowfish in OFB mode
1910
1911cast Alias for cast-cbc
1912cast-cbc CAST in CBC mode
1913cast5-cbc CAST5 in CBC mode
1914cast5-cfb CAST5 in CFB mode
1915cast5-ecb CAST5 in ECB mode
1916cast5-ofb CAST5 in OFB mode
1917
1918des Alias for des-cbc
1919des-cbc DES in CBC mode
1920des-cfb DES in CBC mode
1921des-ecb DES in ECB mode
1922des-ofb DES in OFB mode
1923
1924des-ede Two key triple DES EDE in ECB mode
1925des-ede-cbc Two key triple DES EDE in CBC mode
1926des-ede-cfb Two key triple DES EDE in CFB mode
1927des-ede-ofb Two key triple DES EDE in OFB mode
1928
1929des3 Alias for des-ede3-cbc
1930des-ede3 Three key triple DES EDE in ECB mode
1931des-ede3-cbc Three key triple DES EDE in CBC mode
1932des-ede3-cfb Three key triple DES EDE CFB mode
1933des-ede3-ofb Three key triple DES EDE in OFB mode
1934
1935desx DESX algorithm
1936
1937rc2 Alias for rc2-cbc
1938rc2-cbc 128-bit RC2 in CBC mode
1939rc2-cfb 128-bit RC2 in CFB mode
1940rc2-ecb 128-bit RC2 in ECB mode
1941rc2-ofb 128-bit RC2 in OFB mode
1942rc2-64-cbc 64-bit RC2 in CBC mode
1943rc2-40-cbc 40-bit RC2 in CBC mode
1944
1945rc4 128-bit RC4
1946rc4-40 40-bit RC4
1947.Ed
1948.Sh ENC EXAMPLES
1949Just base64 encode a binary file:
1950.Pp
1951.Dl $ openssl base64 -in file.bin -out file.b64
1952.Pp
1953Decode the same file:
1954.Pp
1955.Dl $ openssl base64 -d -in file.b64 -out file.bin
1956.Pp
1957Encrypt a file using triple DES in CBC mode using a prompted password:
1958.Pp
1959.Dl $ openssl des3 -salt -in file.txt -out file.des3
1960.Pp
1961Decrypt a file using a supplied password:
1962.Pp
1963.Dl "$ openssl des3 -d -in file.des3 -out file.txt -k mypassword"
1964.Pp
1965Encrypt a file then base64 encode it
1966(so it can be sent via mail for example)
1967using Blowfish in CBC mode:
1968.Pp
1969.Dl $ openssl bf -a -salt -in file.txt -out file.bf
1970.Pp
1971Base64 decode a file then decrypt it:
1972.Pp
1973.Dl "$ openssl bf -d -a -in file.bf -out file.txt"
1974.Sh ENC BUGS
1975The
1976.Fl A
1977option when used with large files doesn't work properly.
1978.Pp
1979There should be an option to allow an iteration count to be included.
1980.Pp
1981The
1982.Nm enc
1983program only supports a fixed number of algorithms with certain parameters.
1984Therefore it is not possible to use RC2 with a 76-bit key
1985or RC4 with an 84-bit key with this program.
1986.\" 1824.\"
1987.\" ERRSTR 1825.\" ERRSTR
1988.\" 1826.\"