Beginning Cryptography with Java
by David Hook
Wrox Press ?2005 (480 pages)
ISBN:0764596330
For Java developers who want to use cryptography in their applications or to understand how cryptography is being used in Java applications, this book enables you to create and implement secure Java applications and make use of standard protocols.
Introduction
This book is about using cryptography with Java.
Depending on who you are, you may think of cryptography as a great menace or as a very useful tool. The truth is that in some ways it is neither, in other ways it is both. It's neither because, if you choose, you could easily reduce it to an interesting mathematical game, with no application. It's both because it most definitely gets applied, not always well, and not always for purposes that everyone agrees with. Whichever side of the fence you are on, the one thing everyone agrees with is that the politics surrounding cryptography and access to the technology that allows you to use it have been intense.
Java, on the other hand, is simply a programming language. It arrived on the popular scene in 1995 and has become very popular as a language for writing applications involving the Internet, electronic commerce, or a combination of the two. Other than the odd, often "religious," issue between programmers or companies, the language itself has carried none of the political problems that have accompanied cryptography. However, a language by itself won't allow you to develop secure Internet applications, so it quickly became apparent that it would be necessary to introduce into Java APIs that allowed people to make use of cryptography. When this happened the politics arrived and, for some, using Java suddenly got intense as well. Finally, the politics subsided and we arrived where we are now, with a rich set of APIs that allow developers to use cryptography effectively in application development—providing they know how.
This brings me to why this book was written. People will still wax lyrically about key sizes and PKI (Public Key Infrastructure), but what does it all mean, and what does it mean when you are using Java? The Java APIs afford you a great deal of flexibility, and although this will allow you to implement an application using cryptography at a fundamental level, it will also allow you to tie yourself into some terrible knots. You can avoid this if you understand a few principals about the way the APIs are put together. Furthermore, by understanding the relationships between the high-level APIs and the more fundamental ones, debugging becomes easier and you can recognize when it is not necessary to build things from scratch, as, in some cases, the hard work has already been done. In short, with the right understanding, you can save yourself a lot of work. This book has been written with the aim of providing that understanding.
Who This Book Is For
This book is written for people who are Java developers and are trying to make use of cryptography in their applications and for people who simply want to understand what's going on when cryptography is being used in Java applications. It does assume you are familiar with the Java language, but it does not assume you have any familiarity with any of the APIs it discusses, such as the JCA, JCE, the Bouncy Castle APIs, and JavaMail.
If you are already very familiar with the JCE and the JCA, you might want to skim the first four chapters quickly and start reading thoroughly from Chapter 5 onward; otherwise, I would recommend you start at the beginning. If you do skim the first four chapters, you should pay attention to the development of the utilities class that is added at the start of most chapters. The reason is that the utilities class used in Chapter 5 and onward builds on the work done in the first four chapters.
What This Book Covers
This book has been written to provide you with a basic understanding of how cryptography is done in Java, what some of the issues are in using cryptography in Java, and the higher-level APIs that can save you from both having to reinvent the wheel and also save you from rediscovering mistakes that others have already made.
Of course, discussion is generally not as useful as experience, and the book has been written with numerous examples, each of which should allow you to investigate a specific issue and learn about specific parts of the various Java APIs available to you for implementing cryptography and PKI. In it, you will see how to make use of the APIs available to allow you to
q Do symmetric encryption, asymmetric encryption, and integrity checking.
q Create, validate, and revoke certificates.
q Create and process secured messages and mail.
q Create and use secured channels using SSL.
Naturally, implementing anything in any language always leaves the door open to shooting oneself in the foot, and cryptography is definitely no exception. With this in mind, where possible, examples and their associated explanations have been written to help you avoid some of the common pitfalls, and as this is a beginning book, further reading has also been suggested to allow you to take the concepts further if you need to.
The book has been written to allow you to take full advantage of recent updates in the security APIs with J2SE 5.0; however, you will also find that almost all the examples can be used, with minor modifications, with older JDKs. Barring some specific uses of J2SE 5.0, the minimum version of Java you need to be using to use every API described in the book is JDK 1.3. If you are using an earlier JDK, you can still use this book, but you will find that you will not be able to use all of the examples, such as those dealing with secure mail and SSL.
Download the free chm ebook: Beginning Cryptography with Java
Tags: cryptography, java
anonymous
Powered by
Recent comments