title: How to encrypt a text file using C?
body: <p>I want to have a program like this:</p>
  
  <pre><code>scanf("%s", name);
  scanf("%s", id);
  scanf("%d", &amp;age);
  </code></pre>
  
  <p>Now I want to write <code>name</code>, <code>id</code> and <code>age</code> to a file, but the file should be encrypted, so that only my program can read back the data it wrote.</p>
  
  <p>Do I need to use one of the encryption libraries <a href="https://stackoverflow.com/questions/180870/what-is-the-best-encryption-library-in-c-c">mentioned here</a> (they all are pretty heavy duty libraries, I just need to encrypt a text file), or is there any other simpler method?</p>
  
  <p>If an encryption library is the solution, which one is best suited for a simple text file encryption?</p>