Cryptography has a long and fascinating history. The most complete non-technical account of the subject is Kahn