The Licenses plugin is an automated way to deliver unique license keys to customers who purchase your products. It allows you to store different encryption keys per product and then uses it to create a unique license key once the order is paid and emails it to the customer. The license keys are also added to order notes for future reference.
This download is the full source code for the plugin and is distributed under the MIT license which means you are able to modify it as you see fit. This blog post gives a more thorough breakdown of the code and how it works.