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