Primality testing in polynomial time : from randomized algorithms to PRIMES is in P This book is devoted to algorithms for the venerable primality problem: Given a natural number n decide whether it is prime or composite. The problem is basic in number theory efficient algorithms that solve it i.e. algorithms that run in a number of computational steps which is polynomial in the number of digits needed to write n are important for theoretical computer science and for applications in algorithmics and cryptology. This book gives a self contained account of theoretically and practically important efficient algorithms for the primality problem covering the randomized algorithms by Solovay Strassen and Miller Rabin from the late 1970s as well as the recent deterministic algorithm of Agrawal Kayal and Saxena. The textbook is written for students of computer science in particular for those with a special interest in cryptology and students of mathematics and it may be used as a supplement for courses or for self study