Encryption Basics

In this section we begin discussing cryptography. The packages, classes, and methods discussed in this and following sections are part of Sun’s separately available Java Cryptography Extension ( JCE). As a standard extension to Java, the JCE cryptography classes live in the javax package rather than the java package. They are not part of the core API. You will need to download JCE from http://java.sun.com/products/jce/index.html and install it before continuing.

Because Sun is not legally allowed to export the JCE outside the U.S. and Canada, a number of third parties in other countries have implemented their own versions. In particular, Austria’s Institute for Applied Information Processing and Communications has released the IAIK_ JCE, which is free for noncommercial use and can be retrieved from http://jcewww.iaik.tu-graz.ac.at/products/jce/index.php. Also notable is the more-or-less open source Cryptix package, which can be downloaded from many mirror sites worldwide. See http://www.cryptix.org/.

There are many different kinds of codes and ciphers, both for digital and nondigital data. To be precise, a code encrypts data at word or higher levels. Ciphers encrypt data at the level of letters or, in the case of digital ciphers, bytes. Most ciphers replace each byte in the original, unencrypted data, called plaintext, with a different byte, thus producing encrypted data, called ciphertext. There are many different possible algorithms for determining how plaintext ...

Get Java I/O now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.