From the webpage Cryptography As a Teaching Tool, found at http://www.math.washington.edu/~koblitz/crlogia.html, which was written by Dr. Neal Koblitz, Professor of Mathematics at the University of Washington:
Cryptography has a tremendous potential to enrich math education. In the first place, it puts mathematics in a dramatic setting. Children are fascinated by intrigue and adventure. More is at stake than a grade on a test: if you make a mistake, your agent will be betrayed.
In the second place, cryptography provides a natural way to get students to discover certain key mathematical concepts and techniques on their own. Too often math teachers present everything on a silver platter, thereby depriving the children of the joy of discovery. In contrast, if after many hours the youngsters finally develop a method to break a cryptosystem, then they will be more likely to appreciate the power and beauty of the mathematics that they have uncovered. Later I shall describe cryptosystems that the children can break if they rediscover such fundamental techniques of classical mathematics as the Euclidean algorithm and Gaussian elimination.
In the third place, a central theme in cryptography is what we do not know or cannot do. The security of a cryptosystem often rests on our inability to efficiently solve a problem in algebra, number theory, or combinatorics. Thus, cryptography provides a way to counterbalance the impression that students often have that with the right formula and a good computer any math problem can be quickly solved.
Mathematics is usually taught as if it were a closed book. Other areas of science are associated in children’s minds with excitement and mystery. Why did the dinosaurs die out? How big is the Universe? M. R. Fellows has observed that in mathematics as well, the frontiers of knowledge can and should be put within reach of young students.
Finally, cryptography provides an excellent opportunity for interdisciplinary projects… in the middle or even primary grades.
This webpage provides an excellent mathematical overview as well as some details about to engage students with the mathematics of cryptography.