FluxionTech has a good article on how KeyGen's are created.

It goes into a really rough overview on how proprietory software KeyGen's are created; beware, it assumed a reasonably amount of knowledge of ASM, and some limited C. If you dont know ASM, or even what it looks like you could be confused. Its certainly one of those more interesting articles - definately more interested on “how to rip a DVD”.