4 Message Integrity and Authentication
This chapter covers
- Guaranteeing data integrity using the Secure Hash Algorithm (SHA)
- Ensuring sender authenticity using a Hashed Message Authentication Code (HMAC)
- Ensuring data integrity using an HMAC
- Using the Java Cryptography Architecture (JCA) and Extensions (JCE)
This chapter is the first step in a friendly introduction to cryptographic algorithms for application developers. We will not cover the mathematics of the cryptography algorithms. Instead, we will demonstrate cryptography concepts with working Java examples so you can build the intuition and background to understand application security.
Cryptographic algorithms are the foundational security building blocks, no matter what programming language you write code in or which cloud provider you deploy your application on. Terse documentation and mysterious error messages from security libraries make perfect sense if you understand the basics of cryptography. No more getting stuck and blindly copying and pasting from stackoverflow.com and blog posts.