This book is an introduction to the algorithmic aspects of number theory and its applications to cryptography with special emphasis on the RSA cryptosys-tem. It covers many of the familiar topics of elementary number theory all with an algorithmic twist. The text also includes many interesting historical notes.