We introduce the fundamental concepts of modern cryptography, with a special attention given to the mathematical and algorithmic aspects. Historical problems and constructions are discussed, and will serve as a basis for the construction and discussion of today's most widely used algorithms.