title: How to generate a product license key which includes decodable product information
body: <p>I want to issue a product security key which can encode details of the licensing restrictions. For example, a key could contain the maximum number of licensed users, and/or start/end dates to control license expiry.</p>
  
  <p>I know that a simple way of creating a key is to use an MD5 hash - simply concatenate the details and apply the MD5 hash algorithm. But that is a one way process i.e. you cannot decode the key to see the initial parameters.</p>
  
  <p>What I want to do is issue a key which can be decoded at the user site, and gives them all the licensing parameters. </p>
  
  <p>So the user would get something like this:</p>
  
  <p>1234-5678-9012-3456</p>
  
  <p>which is created using a string composed of the following parameters, concatenated, then hashed</p>
  
  <p>Max users: <strong>50</strong></p>
  
  <p>Start date: <strong>17/01/17</strong></p>
  
  <p>End date: <strong>17/01/18</strong></p>
  
  <p>In the past I've installed software products which come with a license key , and the key somehow has all the information such as expiry date built in. How is this done? Does the software contact a central server to determine the expiry date by consulting a database?
  But I'm sure these license keys worked when the application was offline. Am I mistaken?</p>