Cryptography is a foundation specialized course of information security. It is important for training information security professionals to research how to teach cryptography. In the course, it is difficult for students to learn mathematics in cryptography. It is analyzed the main teaching contents in cryptography in the paper. Afterwards, it is proposed the teaching contents of mathematics and schedule in the course and designed different teaching methods according to different contents. Finally, we analyze the teaching effectiveness. The result indicates the students learn the teaching contents better in the way we designed.