title: What is most secure way to store the license information in registry - c#
body: <p>I making a trail version of my application using win-form C#, for this am storing license information such as install date, last used date, and blacklist user variables in HKEY_CURRENT_USER.</p>
  
  <p>Now am worried that users can easily access this registry information or they can modify its value. If they do so then trail app can be reused after expiry.</p>
  
  <p>Someone, please suggest me the best way to secure this registry information.</p>
  
  <ol>
  <li>how to encrypt registry information?</li>
  <li>how to block modify access to users and at the same time only my application should have rights to modify the registry (as my application modifies last used variable in a registry.</li>
  <li>Any other alternatives ways to secure this license information and same can be used by my c# application( one similar to registry entries where my application can read and modify its property data values)</li>
  </ol>
  
  <p>a piece of my code</p>
  
  <pre><code> private void firstTimeAppOpen()
      {
          RegistryKey regkey = Registry.CurrentUser;
          regkey = regkey.CreateSubKey(globalPath); //path
  
          DateTime dt = DateTime.Now;
          string Date = dt.ToShortDateString(); // get only date not time
  
          regkey.SetValue("Install", Date); //Value Name,Value Data
          regkey.SetValue("Use", Date); //Value Name,Value Data
      }
  
      // put next use day in registry
                  regkey.SetValue("Use", DateTime.Now); //Value Name,Value Data
  </code></pre>
  
  <p>below screenshot showcases that all my data like install date, last used date are all visible and can be modified if the user finds it.
  <a href="https://i.stack.imgur.com/Rwjhf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Rwjhf.jpg" alt="enter image description here"></a></p>