More notes on theoretical aspects of encryption might be found at the course notes for the MIT class 6.857 taught by Ron Rivest. It took it in 1996, and it was most informative. Perhaps it can answer mattbradshaw's question a bit more coherently than me.

**Addendum**

It seems that Public Key security is based on the difficulty of solving the Discrete Log Problem. For large prime numbers p, finding the factors for p-1 seems to be a difficult problem. No P-class algorithms are known, but it is not really easy to prove none exist. Searches for "Discrete Log Problem" might be useful for more information.

Was it Bill Gates who said that one of the challenges for future computer systems is "factoring large primes?" ;)