title: Simple encryption and decryption of a txt document
body: <p>I'm making an application that writes a small txt file containing 3 strings then loads them back into the application in a list widget.</p>
  
  <p>This all works fine, but now I want to make it so that the txt file is not in plain text. I don't need any complicated cipher or anything that needs a key to encrypt and decrypt. I just simply want to be able to encrypt it on saving (saves a document that isn't in plain text) and decrypt it before it loads it back into the lost widget. </p>
  
  <p>Below is my code for writing to and reading from the txt file. I'd just like to rework this so it's not plain text nothing else and I don't care that its not secure just not plain text </p>
  
  <pre><code>QFile m_file("mytext.txt");
  m_file.open(QFile::WriteOnly | QFile::Append);
  QTextStream m_stream(&amp;m_file);
  m_stream &lt;&lt; ui-&gt;txt_1-&gt;text() + "    " + ui-&gt;txt_2-&gt;text() + "    " + ui-&gt;txt_3-&gt;text()                         &lt;&lt;;
  m_file.close(); 
  
  
  
  
  QFile n_file("mytext.txt");
  n_file.open(QFile::ReadOnly);
  QTextStream n_stream(&amp;n_file);
  int i=0;
  while (!n_stream.atEnd())
  {
      ui-&gt;listWidget-&gt;addItem(n_stream.readLine());
      i++;
  }
  </code></pre>