Students who are actively engaged in learning mathematics understand the subject better. In fact, one of the main problems of mathematics education today is to find ways to motivate and engage students in the classroom. In this quantitative study, cryptographic activities are used as an aid in teaching the topic of modular arithmetic in 8th grade and their effects on students’ understanding are examined. The second author taught the topic of modular arithmetic to two groups of students in 8th grade. In the control group the teacher used the traditional method of teaching and in the experimental group he used cryptographic activities and puzzles. The analysis of the data shows that students who learned the subject through cryptographic activities were more successful than students taught traditionally. Attitudes and performances of students in the experimental group are found to be more positively affected by the experience.