title: Application Licensing and Activation Thoughts
body: <p>I have recently developed an app that I plan to sell to small businesses. I do not have a huge backing of cash so I am unwilling to purchase a commerical application that would protect my software against theft.</p>
  
  <p>My current plan is the following:</p>
  
  <ul>
  <li>I include a public key (pgp) or a literal code inside of the app.</li>
  <li>User purchases software off of website providing certain information.</li>
  <li>The site calls a function which creates a product key. This key is emailed/shown to the user after purchase.</li>
  <li>After the user downloads the product, they will have to enter some information along with the provided product key to attempt activation.</li>
  <li>The application contacts a web service at our hosting location. It uses encryption along with other information to create an activation code which is sent back to the application.</li>
  <li>In the future the application will check periodically with the web service to determine if it is authorized.</li>
  <li>Somehow I would like to update the pgp/code during software update so I would possibly need a function that would decrypt the information, update the license, re-encryption, and then update the service database.</li>
  </ul>
  
  <p>So I wonder: </p>
  
  <ol>
  <li>Is this the correct way to do this or is it obsolete now?</li>
  <li>What is the best way to generate unique product keys?</li>
  <li>Is there a way to keep the public/private keys completely off of the client's PC?</li>
  <li>Is there a good way to detect an illegal license? I plan on only offering site wide licenses so I just need to detect the evil little bit torrent/irc people.</li>
  </ol>
  
  <p>Thank you in advance for your help. It is greatly appreciate it.</p>