title: How to prevent a file from being tampered with
body: <p>I want to store confidential data in a digitally signed file, so that I know when its contents have been tampered with. </p>
  
  <p>My initial thought is that the data will be stored in NVPs (name value pairs), with some kind of CRC or other checksum to verify the contents. </p>
  
  <p>I am thinking of implementing the creating (i.e. writing) and verification (reading) of such a file, using ANSI C++.</p>
  
  <p>Assuming this is the data I want to store:</p>
  
  <pre><code>    //Unencrypted, raw data to be stored in file
      struct PrivateInfo {
           double age; weight;
           FitnessScale fitness;
           Location  loc;
           OtherStuff stuff;
      };
  
      //128-bit Encrypted Data (Payload to be stored in file)
      struct EncryptedData {
       // unknown fields/format ??
  
      };
  </code></pre>
  
  <p><em>[After I have read a few responses to this question]</em></p>
  
  <p>Judging by the comments I have received so far, I fear people are getting side tracked by the word "licensing" which seems to be a red flag to most people. I suspected that may be the case, but in todays atmosphere of heightened security and general nervousness, I thought I'd better detail what I needed to be "hiding" lest someone thought I was thinking of passing on the "Nuke password" to some terrorists or something. I will now remove the word "license" from my question.</p>
  
  <p>View it more as a technical question. Imagine I am a student (which I am), and that I am trying to find out about recommended (or best practices) for encoding information that needs to be secure.</p>
  
  <p>Mindful of the above, I will reformat my questions thus:</p>
  
  <ol>
  <li>Given a struct of different data type fields, what is the "recommended" algorithm to give it a "reasonable secure" encryption (I still prefer to use 128 bit - but thats just me)</li>
  <li>What is a recommended way of providing a <strong>ROBUST</strong> check on the encrypted data, so I can use that check value to know if the contents of the file (the Payload of encrypted data) differs from the original.?</li>
  </ol>