title: Simple text-file encryption in C++
body: <p>So I was looking at ways to lock file folders with a password in windows, and this type of security is not really supported.</p>
  
  <p>Given I know C++ I was wondering if I could simply do this myself.</p>
  
  <p>It would be simple enough, in the case of a text file, to copy the entire contents of the file into a C-string. I could then use basic logic to prompt for a password, if it matches, use an fstream overload and insert the whole string into a text file.</p>
  
  <p>Then, simply wipe the file when I'm done using it.</p>
  
  <p>I basically know how to do this, and the result would be a string containing the document compiled into a .exe which I assume would be unreadable. The thing is, I've never really studied encryption or computer security so I'm wondering how secure this would be, or if there is a better way to do this? </p>
  
  <p>Could it be done on photo or video files as well, if so, how? </p>
  
  <p>How hard would it be to reverse (decompile) the process?</p>
  
  <p>What types of things could I do to make reversal more difficult, ie. using multiple strings, or mixing in random characters?</p>
  
  <p>I'm not looking to hide super-sensitive files, I'm just curious about encryption basics.</p>