This document discusses Fermat's and Euler's theorems regarding prime numbers and their applications in cryptography. It begins by defining prime numbers, prime factorization, and greatest common divisors. It then explains Fermat's theorem that any integer to the power of a prime number minus one is congruent to one modulo that prime number. Next, it defines Euler's totient function and proves Euler's theorem, which generalizes Fermat's theorem. It concludes by providing an example of how these theorems can be applied to encrypt and decrypt messages in a public-key cryptography system.