Java Cryptography
Jonathan B. Knudsen
First Edition May 1998
ISBN: 1-56592-402-9, 362 pages
Java Cryptography teaches you how to write secure programs using
Java's cryptographic tools.
It includes thorough discussions of the java.security package and the
Java Cryptography Extensions (JCE), showing you how to use security
providers and even implement your own provider.
It discusses authentication, key management, public and private key
encryption, and includes a secure talk application that encrypts all data
sent over the network.
If you work with sensitive data, you'll find this book indispensable.
Table of Contents
Preface 1
1. Introduction 5
Secure Systems
Cryptography
Platform Security
Astute Inequalities
Hello, zoT1wy1njA0=!
2. Concepts 13
Confidentiality
Integrity
Authentication
Random Numbers
Algorithms
3. Architecture 24
Alphabet Soup
Concept Classes
API and SPI
Factory Methods
Standard Names
The Provider Architecture
Key Management
Summary
4. Random Numbers 32
SecureRandom
Self-Seeding
Keyboard Timing
SeederDialog
5. Key Management 40
Keys
Key Generators
Key Translators
Key Agreement
The Identity Key Management Paradigm
The KeyStore Key Management Paradigm
6. Authentication 70
Message Digests
MACs
Signatures
Certificates
7. Encryption 89
Streams and Blocks
Block Ciphers
Algorithms
javax.crypto.Cipher
Cipher's Close Relatives
Passphrase Encryption
Inside Cipher
Hybrid Systems
Table of Contents (cont...)
8. Signed Applets 119
Renegade
HotJava
Navigator
Internet Explorer
Summary
9. Writing a Provider 131
Getting Started
Adding the ElGamal Classes
ElGamal
Generating Keys
Signature
Cipher
10. SafeTalk 144
Using SafeTalk
Under the Hood
11. CipherMail 157
Using CipherMail
Under the Hood
12. Outside the Box 174
Application Design
Decompilers and Bytecode Obfuscation
Endpoint Security
File Security
Network Security
Summary
A. BigInteger 180
B. Base64 182
C. JAR 185
D. Javakey 188
E. Quick Reference 195
Colophon 247
Article: Why is Java Cryptography so Important? 248
Description
Cryptography, the science of secret writing, is the biggest, baddest security tool in the application
programmer's arsenal. Cryptography provides three services that are crucial in secure programming.
These include a cryptographic cipher that protects the secrecy of your data; cryptographic certificates,
which prove identity (authentication); and digital signatures, which ensure your data has not been
damaged or tampered with.
This book covers cryptographic programming in Java. Java 1.1 and Java 1.2 provide extensive support
for cryptography with an elegant architecture, the Java Cryptography Architecture (JCA). Another set
of classes, the Java Cryptography Extension (JCE), provides additional cryptographic functionality.
This book covers the JCA and the JCE from top to bottom, describing the use of the cryptographic
classes as well as their innards.
The book is designed for moderately experienced Java programmers who want to learn how to build
cryptography into their applications. No prior knowledge of cryptography is assumed. The book is
peppered with useful examples, ranging from simple demonstrations in the first chapter to full-blown
applications in later chapters.
Topics include:
• The Java Cryptography Architecture (JCA)
• The Java Cryptography Extension (JCE)
• Cryptographic providers
• The Sun key management tools
• Message digests, digital signatures, and certificates (X509v3)
• Block and stream ciphers
• Implementations of the ElGamal signature and cipher algorithms
• A network talk application that encrypts all data sent over the network
• An email application that encrypts its messages
• Creating signed applets
Covers JDK 1.2 and JCE 1.2.