title: c#, how to store and check a generated license key?
body: <p>I read quite a lot about RSA, Encryption, License Keys etc. but I'm still confused.</p>
  
  <p>We have a web application which can be installed locally by customers (they usually should choose the SaaS version, but some might not want it)
  The app has different modules etc. (pretty standard)</p>
  
  <p>Our backend stores the customer data and the licenses/bought modules and is accessible via SSL.</p>
  
  <p>The "client" will periodically check if the issued license is still valid.</p>
  
  <p>What's quite unclear to me is how do I store the license key and/or data like "how long is the license valid"</p>
  
  <p>My thoughts so far:</p>
  
  <ul>
  <li><p>just save it in a table (cleartext) and the periodic license check ensures the validity of the license even when the user tampers with the data in the database. (user might have access to parts he shouldn't for a short time)</p></li>
  <li><p>Encrypt it and save it in a table. This would mean that I either</p>
  
  <ul>
  <li><p>use a shared key</p></li>
  <li><p>use a private/public key: So either have to decrypt with the public key (on the client) or send it to the Backend to decrypt and send it back to the client.</p></li>
  </ul></li>
  </ul>
  
  <p>I just have the feeling encrypting the whole thing is an overhead.</p>
  
  <p>I'm no expert in security and/or cryptography.</p>
  
  <p>So my question is</p>
  
  <ul>
  <li>What is the best practise when checking/storing licenses (and its data)?</li>
  </ul>
  
  <p>Thanks.</p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>I removed the question "Is the SSL enough?" in the last paragraph because I realized this is a different topic.</p>