If interested there is a very good book about this subject: http://www.amazon.com/Fermats-Enigma-Greatest-Mathematical-P...
For anyone who hasn't read them Simon Singh's books are great introductions to subjects by tracking their history. In this case mathematics, but he also has one about cryptography [1] and another on the space and the universe [2].
[1] http://www.amazon.co.uk/Code-Book-Science-Secrecy-Cryptograp...
[2] http://www.amazon.co.uk/Big-Bang-Important-Scientific-Discov...