title: AES Encryption - Key versus IV
body: <p>The application I am working on lets the user encrypt files. The files could be of any format (spreadsheet, document, presentation, etc.).</p>
  
  <p>For the specified input file, I create two output files - an encrypted data file and a key file. You need both these files to obtain your original data. The key file must work only on the corresponding data file. It should not work on any other file, either from the same user or from any other user.</p>
  
  <p>AES algorithm requires two different parameters for encryption, a key and an initialization vector (IV).</p>
  
  <p>I see three choices for creating the key file:</p>
  
  <ol>
  <li>Embed hard-coded IV within the application and save the key in the key file.</li>
  <li>Embed hard-coded key within the application and save the IV in the key file.</li>
  <li>Save both the key and the IV in the key file.</li>
  </ol>
  
  <p>Note that it is the same application that is used by different customers.</p>
  
  <p>It appears all three choices would achieve the same end goal. However, I would like to get your feedback on what the right approach should be.</p>