18.12.2012 Views

O'Reilly - Practical UNIX & Internet Sec... 7015KB

O'Reilly - Practical UNIX & Internet Sec... 7015KB

O'Reilly - Practical UNIX & Internet Sec... 7015KB

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

[Chapter 6] 6.4 Common Cryptographic Algorithms<br />

●<br />

Output Feedback (OFB)<br />

Each mode has particular advantages in some circumstances, such as when transmitting text over a noisy channel,<br />

or when it is necessary to decrypt only a portion of a file. The following provides a brief discussion of these four<br />

methods; consult FIPS PUB 81 or a good textbook on cryptography for details.<br />

●<br />

●<br />

●<br />

●<br />

ECB Mode. In electronic code book (ECB) mode, each block of the input is encrypted using the same key,<br />

and the output is written as a block. This method performs simple encryption of a message, a block at a<br />

time. This method may not indicate when portions of a message have been inserted or removed. It works<br />

well with noisy transmission channels - alteration of a few bits will corrupt only a single 64-bit block.<br />

CBC Mode. In cipher block chaining (CBC) mode, the plaintext is first XOR'ed with the encrypted value<br />

of the previous block. Some known value (usually referred to as the initialization vector, or IV) is used for<br />

the first block. The result is then encrypted using the key. Unlike ECB mode, long runs of repeated<br />

characters in the plaintext will be masked in the output. CBC mode is the default mode for Sun<br />

Microsystems' des program.<br />

CFB Mode. In cipher feedback (CFB) mode, the output is fed back into the mechanism. After each block is<br />

encrypted, part of it is shifted into a shift register. The contents of this shift register are encrypted with the<br />

user's key value using (effectively) ECB mode, and this output is XOR'd with the data stream to produce<br />

the encrypted result. This method is self synchronizing, and enables the user to decrypt only a portion of a<br />

large database by starting a fixed distance before the start of the desired data.<br />

OFB Mode. In output feedback (OFB) mode, the output is also fed back into the mechanism. A register is<br />

initialized with some known value (again, the IV). This register is then encrypted with (effectively) ECB<br />

mode using the user's key. The result of this is used as the key to encrypt the data block (using an XOR<br />

operation), and it is also stored back into the register for use on the next block. The algorithm effectively<br />

generates a long stream of key bits that can be used to encrypt/decrypt communication streams, with good<br />

tolerance for small bit errors in the transmission. This mode is almost never used in <strong>UNIX</strong>-based systems.<br />

All of these modes require that byte and block boundaries remain synchronized between the sender and recipient.<br />

If information is inserted or removed from the encrypted data stream, it is likely that all of the following data<br />

from the point of modification can be rendered unintelligible.<br />

6.4.4.3 DES strength<br />

Ever since DES was first proposed as a national standard, some people have been suspicious of the algorithm.<br />

DES was based on a proprietary encryption algorithm developed by IBM called Lucifer, which IBM had<br />

submitted to the National Bureau of Standards (NBS)[16] for consideration as a national cryptographic standard.<br />

But whereas Lucifer had a key that was 112 bits long, the DES key was shortened to 56 bits at the request of the<br />

National <strong>Sec</strong>urity Agency. The NSA also requested that certain changes be made in the algorithm's S-boxes.<br />

Many people suspected that NSA had intentionally weakened the Lucifer algorithm, so the final standard adopted<br />

by NBS would not pose a threat to the NSA's ongoing intelligence collection activities. But nobody had any<br />

proof.<br />

[16] NBS later became the National Institute of Standards and Technology.<br />

Today the DES is more than 20 years old, and the algorithm is definitely showing its age. Recently Michael<br />

Weiner, a researcher at Bell Northern Research, published a paper detailing how to build a machine capable of<br />

decrypting messages encrypted with the DES by conducting an exhaustive key search. Such a machine could be<br />

built for a few million dollars, and could break any DES-encrypted message in about a day. We can reasonably<br />

assume that such machines have been built by both governments and private industry.<br />

file:///C|/Oreilly Unix etc/<strong>O'Reilly</strong> Reference Library/networking/puis/ch06_04.htm (6 of 14) [2002-04-12 10:44:44]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!