Wikipedia: "Primality Test"

Read this article on primality testing, which is crucial to the security of public-key cryptography. Make sure you understand the naive tests, probabilistic tests, and fast deterministic tests.