This text illustrates algorithms and cryptosystems using examples and the open-source computer algebra system of Sage. It enables students to run their own programs and develop a deep and solid understanding of the mechanics of cryptography. The author, a noted educator in the field, covers the methods, algorithms, and applications of modern cryptographic systems. He provides a highly practical learning experience by progressing at a gentle pace, keeping mathematics at a manageable level, and including numerous end-of-chapter exercises.