|
NAMEbdes —
encrypt/decrypt using the Data Encryption Standard (DES)
SYNOPSIS
DESCRIPTIONThebdes utility implements all DES modes of operation
described in FIPS PUB 81, including alternative
cipher feedback mode and both authentication modes. The
bdes utility reads from the standard input and writes
to the standard output. By default, the input is encrypted using cipher block
chaining (CBC) mode. Using the same key for encryption and decryption
preserves plain text.
All modes but the electronic code book (ECB) mode require an initialization vector; if none is supplied, the zero vector is used. If no key is specified on the command line, the user is prompted for one (see getpass(3) for more details). The options are as follows:
The key and initialization vector are taken as sequences of ASCII
characters which are then mapped into their bit representations. If either
begins with “ According to the DES standard, the low-order bit of each character in the key string is deleted. Since most ASCII representations set the high-order bit to 0, simply deleting the low-order bit effectively reduces the size of the key space from 2^56 to 2^48 keys. To prevent this, the high-order bit must be a function depending in part upon the low-order bit; so, the high-order bit is set to whatever value gives odd parity. This preserves the key space size. Note this resetting of the parity bit is not done if the key is given in binary or hex, and can be disabled for ASCII keys as well. The DES is considered a very strong cryptosystem, and other than
table lookup attacks, key search attacks, and Hellman's time-memory tradeoff
(all of which are very expensive and time-consuming), no cryptanalytic
methods for breaking the DES are known in the open literature. No doubt the
choice of keys and key security are the most vulnerable aspect of
IMPLEMENTATION NOTESFor implementors wishing to write software compatible with this program, the following notes are provided. This software is believed to be compatible with the implementation of the data encryption standard distributed by Sun Microsystems, Inc.In the ECB and CBC modes, plaintext is encrypted in units of 64
bits (8 bytes, also called a block). To ensure that the plaintext file is
encrypted correctly, Unlike Sun's implementation, unused bytes of that last block are not filled with random data, but instead contain what was in those byte positions in the preceding block. This is quicker and more portable, and does not weaken the encryption significantly. If the key is entered in ASCII, the parity bits of the key characters are set so that each key character is of odd parity. Unlike Sun's implementation, it is possible to enter binary or hexadecimal keys on the command line, and if this is done, the parity bits are not reset. This allows testing using arbitrary bit patterns as keys. The Sun implementation always uses an initialization vector of 0
(that is, all zeroes). By default, SEE ALSOgetpass(3)Data Encryption Standard, Federal Information Processing Standard #46, National Bureau of Standards, U.S. Department of Commerce, Washington DC, January 1977. DES Modes of Operation, Federal Information Processing Standard #81, National Bureau of Standards, U.S. Department of Commerce, Washington DC, December 1980. Dorothy Denning, Cryptography and Data Security, Addison-Wesley Publishing Co., Reading, MA, 1982. Matt Bishop, Implementation Notes on bdes(1), Technical Report PCS-TR-91-158, Department of Mathematics and Computer Science, Dartmouth College, Hanover, NH 03755, April 1991. DISCLAIMERTHIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. BUGSThere is a controversy raging over whether the DES will still be secure in a few years. The advent of special-purpose hardware could reduce the cost of any of the methods of attack named above so that they are no longer computationally infeasible.As the key or key schedule is stored in memory, the encryption can
be compromised if memory is readable. Additionally, programs which display
programs' arguments may compromise the key and initialization vector, if
they are specified on the command line. To avoid this
Certain specific keys should be avoided because they introduce
potential weaknesses; these keys, called the weak and
semiweak keys, are (in hex notation, where
p is either 0 or 1, and P is
either ‘
This is inherent in the DES algorithm; see Moore and Simmons, Cycle structure of the DES with weak and semi-weak keys, Advances in Cryptology - Crypto '86 Proceedings, pp. 9-32, Springer-Verlag New York, 1987.
Visit the GSP FreeBSD Man Page Interface. |