The Joy of Cryptography

by Mike Rosulek Twitter profile

The Joy of Cryptography is a free undergraduate-level textbook that introduces students to the fundamentals of provable security.

Latest draft: Jan 3, 2021; 286 pages

Table of Contents

  1. Preface
  2. Review of Concepts & Notation
  3. One-Time Pad
  4. The Basics of Provable Security
  5. Secret Sharing
  6. Basing Cryptography on Intractable Computations
  7. Pseudorandom Generators
  8. Pseudorandom Functions & Block Ciphers
  9. Security against Chosen Plaintext Attacks
  10. Block Cipher Modes of Operation
  11. Chosen Ciphertext Attacks
  12. Message Authentication Codes
  13. Hash Functions
  14. Authenticated Encryption & AEAD
  15. RSA & Digital Signatures
  16. Diffie-Hellman Key Agreement
  17. Public-Key Encryption
  18. Index of security definitions

About the Author

Mike Rosulek is a cryptographer and associate professor in the School of EECS at Oregon State University. He has taught cryptography for over 12 years.

For inquiries related to this book, use, where x is the author's first name.

Additional Information

This book assumes knowledge of basic discrete math concepts; a quick review of these topics is provided in Chapter 0. Readers may also benefit from some familiarity with data structures, algorithms, and theoretical computer science.

Sorry, there are no solutions available for the exercises.

All the sensible textbook titles were already taken. Actual joy not guaranteed.

This book is licensed under Creative Commons BY-NC-SA 4.0. You must give attribution to the author, must not use this book for commercial purposes, and must distribute derivative works under the same license.

You can find even more information in the book's preface.

Follow @JoyOfCrypto on Twitter for updates.

Argument from Authority

The Joy of Cryptography has been used as a primary reference in courses at the following universities:

I would love to hear from you if your university has been using the book!

How to Cite

    title        = "The Joy of Cryptography",
    author       = "Mike Rosulek",
    note         = "\url{}",
    url          = ""


This book is possible with support from the National Science Foundation and the Open Textbook Initiative at Oregon State University. Web page design adapted from simple.css by Kev Quirk.