SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This book is a comprehensive guide to Java security issues. It assumes you are an experienced Java programmer, but have little experience with creating secure applications. This book covers formulating and enacting a network security policy to protect end-users, building e-commerce and database applications that can safely exchange secure information over networks and the Internet, cryptography, digital signatures, key management, and distributed computing: CORBA, RMI, and servlets.
Introduction.
I. THE FOUNDATIONS OF JAVA SECURITY.
1. Security Basics.The Basic Security Model. Cryptography.
Classes of Cryptography. Message Digests. Symmetric Keys. Asymmetric Keys.
Authentication and Nonrepudiation.
Authentication Types. Nonrepudiation.
Access Control.
Discretionary Access Control. Role-Based Access Control. Mandatory Access Control. Firewall Access Control.
Domains. Auditing. Policies and Administration. Summary.
2. Java Security Overview.The History of Security in Java. Java Security Architecture.
Core Java 2 Security Architecture. Java Cryptography Architecture. Java Cryptography Extension. Java Secure Socket Extension. Java Authentication and Authorization Service.
Byte Code Verifier. Class Loader.
Class Loader Architecture and Security. Class-Loader Interfaces.
Security Manager.
Security Manager Interfaces. Custom Security Managers.
Java Cryptography Architecture.
The Architecture of JCA. Cryptographic Engines. Cryptographic Service Providers.
Summary.
3. Java Application Security Access Control.Permissions.
Permissions Architecture. Permission Types. Custom Permission Types.
Security Policies.
Security Policy File Format. Referencing Properties in Policy Files. Using Security Policy Files. Security Policy Tool. Security Policy APIs.
Java Access Control.
Access Control Architecture. Guarded Objects. SecurityManager-to-Access Control Mapping. Fine-Grained and Configurable Access Control Example.
Summary.
4. Applet Security.Extending the Sandbox.
The JDK 1.0 Sandbox. The JDK 1.1 Sandbox. JDK 1.2 Least Privilege.
Specifying an Applet Security Policy.
The Contents of the Security Policy File. The Syntax of Grant Entries.
Using Signed Applets.
Creating the JAR file. Signing the JAR File. Specifying a Signed Applet Policy.
Obtaining a Signing Certificate. Working with Different Browsers. Summary.
II. CRYPTOGRAPHIC SECURITY.
5. Introduction to Cryptography.A Short History of Secret Writing. Cryptography, Cryptanalysis, and Cryptology. Ciphers.
The Caesar Cipher. A Simple Substitution Cipher.
Secret-Key Cryptography.
The Data Encryption Standard (DES). DESede. Blowfish. Rivest Ciphers.
Public Key Cryptography.
The Rivest, Shamir, Adleman (RSA) Algorithm. The ElGamal Algorithm.
Message Digests.
MD5. SHA-1. Base 64 Encoding.
Digital Signatures.
The Digital Signature Algorithm.
Digital Certificates. Summary.
6. Key Management and Digital Certificates.Importance of Key Management. Key Representation. Key Generation.
The KeyPairGenerator Class. The KeyGenerator Class. The KeyGeneratorApp Program. Secure Random Numbers and Key Generation. Key Translation.
Key Agreement.
Simple Key Management for Internet Protocols (SKIP). JCE Support for Key Agreement.
Key Storage and Password-Based Encryption. Key Management Differences Between JDK 1.1 and the Java 2 Platform (version JDK 1.2).
JDK 1.1 Key Management. JDK 1.2 Key Management.
The Keytool. Summary.
7. Message Digests and Digital Signatures.Message Digest Classes and Interfaces.
MessageDigestSpi. MessageDigest. DigestInputStream and DigestOutputStream. Working with Digest Streams. DigestException.
Message Authentication Codes.
MacSpi. Mac. MACs in Action.
Signature Classes and Interfaces.
SignatureSpi. Signature. SignedObject. Signer. SignatureException.
Summary.
8. The Java Cryptography Extension.Inside the JCE. The Cryptix JCE. Security Providers and Algorithm Independence. How a Security Provider Is Organized.
Engine Classes. SPI Classes. Provider Classes.
Creating a New Provider.
Extending the SPI Class. Extending the Provider Class. Installing Provider Classes.
Using the Provider. Summary.
9. SSL and JSSE.SSL Overview. Java Secure Socket Extension Overview.
JSSE Package and Class Overview.
JSSE Providers. JSSE SSL Server Sockets.
Obtaining an SSL Server Socket Factory. Creating SSL Server Sockets. SSL Server Socket Listening. Client Authentication.
JSSE SSL Client Sockets.
Obtaining an SSL Socket Factory. Creating SSL Client Sockets.
JSSE SSL Sessions. Summary.
III. DISTRIBUTED SYSTEM SECURITY.
10. Distributed Enterprise Security Overview.Distributed Enterprise System Technology.
Enterprise Database Connectivity. Enterprise Communications. Enterprise Communication Services. Enterprise Container-Based Components.
Enterprise Database Connectivity Security. Enterprise Communications Security.
Basic Network Security. RMI Security. CORBA Security.
Enterprise Communications Service Security.
JNDI Security. Jini Security. JMS Security. JavaMail Security.
Enterprise Container-Based Component Security.
Web Component Security. EJB Security.
Summary.
11. Databases and Database Security.What Is a Database? Relational Databases.
Working with Keys.
Structured Query Language. Remote Database Access.
ODBC and JDBC Drivers.
Connecting to Databases with the java.sql Package.
Setting Up a Database Connection. Executing SQL Statements. The StatementApp Program.
Database Security Issues.
Securing Database Connections. Securing the User Connection. Auditing. Database Scanning.
Summary.
12. The Java Authentication and Authorization Service.JAAS Overview. JAAS Subjects.
Subject Relationships. Creating Subjects. Manipulating Subject Attributes. Specializing Subject Credentials.
Authentication with JAAS.
Login Module Configuration and Initialization. The Authentication Process. Callback Handling.
Authorization with JAAS.
JAAS Security Policy File Format. Using JAAS Security Policy Files. Performing Security-Critical Actions. JAAS Security Authorization Abstractions. Standard Java Security Policies with JAAS Permissions.
Summary.
13. CORBA Security.CORBA Security Overview.
CORBA Security Packages. CORBA Security Architecture. Core CORBA Security Interfacing.
Authentication. Delegation. Authorization. Auditing. Nonrepudiation. Encryption. Security Policies. Security Administration. Summary.
14. Enterprise JavaBeans Security.EJB Security Overview. Standard Programmatic EJB Access Controls. Standard Declarative EJB Access Controls. Vendor-Specific EJB Access Controls. Vendor-Specific EJB Identity and Authentication. EJB Secure Communications, Delegation, and Auditing.
EJB Connection Security. EJB Principal Delegation. EJB Security Auditing.
Summary.
15. Java Servlet and JSP Security.The Common Gateway Interface.
Web Server-to-CGI Program Communication. CGI Program-to-Web Server Communication.
Session State Maintenance.
Cookies. URL Rewriting. Hidden Form Fields.
Server-Side Programming Security Issues.
Interception of Session State Information. Forgery of Session State Information. Buffer Overflow. Data Validation. Page Sequencing. Session Timeout. Information Reporting. Browser Residue. User Authentication. Logging of Sensitive Information. Least Privilege.
Java Servlets.
Why Servlets? The Servlet API. How Servlets Work. Servlet Examples. Servlet Security.
JavaServer Pages. Summary.
IV. APPENDIXES.
Appendix A. Past Java Security Flaws.JavaScript (February, 1996). DNS Attack (February, 1996). Class Loader Implementation Bug (March, 1996). Verifier Implementation Bug (March, 1996). URL Name Resolution Attack (April, 1996). Hostile Applets (April, 1996). Classloader Attack Variant (May 18, 1996). Illegal Type Cast Attack (June 2, 1996). Inconsistency in javakey (December 13, 1996). Web Spoofing (December, 1996). Java Versus ActiveX (February 25, 1997). Virtual Machine Bug (March 5, 1997). Disclosure of IP Addresses (March 17, 1997). Signing Flaw (April 29, 1997). Verifier Bugs (May 16, 1997). Another Verifier Bug (June 23, 1997). RSA PKCS1 Risk in SSL (June 26, 1998). Princeton Classloader Attack (July 22, 1998). Execution of Unverified Code (March 26, 1999). Construction of Unverified Classes (April 14, 1999). Locally Installed Applet Classes (February 2, 2000).
Appendix B. The Mathematics of RSA.The Math Behind RSA.
The Prime Numbers Are Infinite. Primality Testing. Prime Number Generation. Finding an Encryption Key. Calculating d from e, p, and q.
Cryptix and RSA. Encryption and Decryption. Computing and Verifying Signatures.
Appendix C. Downloading and Installing the JCE.Downloading the JCE. Installing the JCE. Testing Your Installation.
Appendix D. The Java 2 Security API.The java.security Package.
Interfaces. Classes. Exceptions.
The java.security.acl Package.
Interfaces. Classes. Exceptions.
The java.security.cert Package.
Interfaces. Classes. Exceptions.
The java.security.interfaces Package.
Interfaces. Classes. Exceptions.
The java.security.spec Package.
Interfaces. Classes. Exceptions.
The javax.crypto Package.
Interfaces. Classes. Exceptions.
The javax.crypto.interfaces Package.
Interfaces. Classes. Exceptions.
The javax.crypto.spec Package.
Interfaces. Classes. Exceptions.
Appendix E. Downloading and Installing the Cryptix JCE 1.2.Downloading the Cryptix 3.1. Installing Cryptix 3.1. Testing Your Installation.
Appendix F. Using the Keytool.Overview. Keystore Locations. Keytool Commands.
The -certreq Command. The -delete Command. The -export Command. The -genkey Command. The -help Command. The -identitydb Command. The -import Command. The -keyclone Command. The -keypasswd Command. The -list Command. The -printcert Command. The -selfcert Command. The -storepasswd Command.
The Cacerts Keystore.
Appendix G. Using the jarsigner Tool.JAR Files.
Using the jar Tool. Creating a JAR File. Viewing a JAR File. Extracting the Contents of a JAR File.
Signing JAR Files.
Using jarsigner to Sign a JAR File. Verifying the Signature of a JAR File.
Changing the Applet Security Policy.