title: Creating an encrypted log file
body: <p>I am creating a client side application which needs to create a log of the user activity but for various reasons this log must not be human readable.</p>
  
  <p>Currently for my development I am creating a plain text log which looks something like this:</p>
  
  <pre><code>12/03/2009 08:34:21 -&gt; User 'Bob' logged in
  12/03/2009 08:34:28 -&gt; Navigated to config page
  12/03/2009 08:34:32 -&gt; Option x changed to y
  </code></pre>
  
  <p>When I deploy my application, the log must not be in plain text, so all text must be encrypted. This doesn't appear to be straightforward to achieve as I need the log file to dynamically update as each entry is added.</p>
  
  <p>The approach I was thinking about was to create a binary file, encrypt each log entry in isolation and then append it to the binary file with some suitable demarcation between each entry.</p>
  
  <p>Does anyone know of any common approaches to this problem, I'm sure there has to be a better solution!</p>