23.07.2013 Views

Java IO.pdf - Nguyen Dang Binh

Java IO.pdf - Nguyen Dang Binh

Java IO.pdf - Nguyen Dang Binh

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

IDEA<br />

RC2<br />

RC4<br />

Blowfish<br />

<strong>Java</strong> I/O<br />

The International Data Encryption Algorithm developed and patented by Dr. X. Lai and<br />

Professor J. Massey of the Federal Institute of Technology in Zurich, Switzerland; a symmetrical<br />

64-bit block cipher with a 128-bit key; the algorithm is published but patented. The patent<br />

expires in 2010 in the U.S., 2011 in Europe; see http://www.ascom.com/infosec/idea.html.<br />

A variable key-size symmetric 64-bit block cipher designed by Ron Rivest as a drop-in<br />

replacement for DES; it is generally allowed to be exported with a 40-bit key size and sometimes<br />

with a 56-bit key length (which probably means the NSA doesn't have much trouble breaking it);<br />

see IETF RFC 2268, http://www.faqs.org/rfcs/.<br />

A symmetric stream cipher algorithm proprietary to RSA Data Security, Inc. used in Netscape's<br />

Secure Sockets Layer (SSL), among other products. RC4 is a stream cipher designed by Ron<br />

Rivest; since the U.S. government occasionally allows this to be exported, the NSA probably<br />

knows how to break it. See ftp://idea.sec.dsi.unimi.it/pub/security/crypt/code/rc4.revealed.gz and<br />

Chapter 17.1 of Bruce Schneier's Applied Cryptography.<br />

An unpatented fast, free, symmetric, variable key length (32 to 448 bits) 64-bit block cipher<br />

designed by Bruce Schneier as a drop-in replacement for DES; see<br />

http://www.counterpane.com/blowfish.html.<br />

When faced with input longer than its block size, a block cipher must divide and possibly<br />

reorder that input into blocks of the appropriate size. The algorithm used to do this is called a<br />

mode. A mode name may be included in the transformation string separated from the<br />

algorithm by a slash. If a mode is not selected, the provider supplies a default. Modes apply to<br />

block ciphers in general and DES in particular, though other block ciphers like Blowfish may<br />

use some of these modes as well. The named modes in the JCE are listed in Table 10.4. All of<br />

these modes are supported by the JCE, but modes are algorithm-specific. If you try to use an<br />

unsupported mode or a mode that doesn't match the algorithm, a<br />

NoSuchAlgorithmException is thrown.<br />

Table 10.4. Block Cipher Modes<br />

Name Mode<br />

Electronic CodeBook Mode; the 64-bit blocks are encrypted independently of each other and may also be<br />

decrypted independently of each other, so this mode is useful when you want random access to an<br />

encrypted file but in general is less secure than other modes. It does not require an initialization vector.<br />

ECB<br />

See "DES Modes of Operation," National Institute of Standards and Technology Federal Information<br />

Processing Standards Publication 81, December 1980; see http://www.itl.nist.gov/div897/pubs/fip81.htm<br />

(NIST FIPS PUB 81).<br />

Cipher Block Chaining Mode, as defined in NIST FIPS PUB 81; best choice for encrypting files; uses an<br />

CBC<br />

initialization vector.<br />

K-bit Cipher FeedBack Mode, as defined in NIST FIPS PUB 81; best choice for real-time encryption of<br />

CFB streaming data such as network connections where each byte must be sent immediately rather than being<br />

buffered; uses an initialization vector.<br />

K-bit Output FeedBack Mode, as defined in NIST FIPS PUB 8; designed so that a 1-bit error in the<br />

OFB ciphertext only produces a 1-bit error in the plaintext; therefore, the best choice on noisy, error-prone<br />

channels; uses an initialization vector.<br />

Propagating Cipher Block Chaining, as used in pre-Version 5 Kerberos; similar to the more secure CBC<br />

PCBC<br />

mode used in Kerberos Version 5 and later; uses an initialization vector.<br />

If the algorithm is a block cipher like DES, then the transformation string may include a<br />

padding scheme that's used to add extra bytes to the input to fill out the last block. The named<br />

padding schemes are shown in Table 10.5. Algorithms that use modes must generally also<br />

specify the padding scheme.<br />

215

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

Saved successfully!

Ooh no, something went wrong!