Introduction
Encryption is the process of scrambling data so that it can be sent in plain sight between two or more parties without anyone else being able to understand what was sent. Today, almost everything you do online is encrypted—be it reading an email, sending a photo to a popular social network, or downloading source code. Most serious websites today are also encrypted. Applying encryption to your software is vital for safeguarding your integrity, data, and business, as well as that of your customer.
Note
Encryption is a very complicated topic that gets more complex every year as we try to safeguard our applications from new malicious code and individuals. This chapter will not go into detail about how encryption should be implemented in software. Instead, we will explain how you can use the APIs that are available within Java.
In Java, we have a collection of classes and interfaces that have been specifically created for handling most security-related cases...