This book covers everything you need to know to write professional-level cryptographic code. This expanded, improved second edition includes about 100 pages of additional material as well as numerous improvements to the original text. The chapter about random number generation has been completely rewritten, and the latest cryptographic techniques are covered in detail. Furthermore, this book covers the recent improvements in primality testing.