Truncation of "key generator".
A small program that will generate a key or serial/registration number for a piece of software. Typically used as an adjunct to software piracy.
The advantage of using a keygen (as opposed to just finding a serial on the web) is that the generated key will be unique, (as it is generated on the spot using the same methods as the software vendor) and not traceable or in use by the legitimate owner.
Written by cryptology enthusiasts who have far to much time on their hands.