title: Check if File is encrypted or not
body: <p>As per this <a href="https://www.codeproject.com/Articles/26085/File-Encryption-and-Decryption-in-C" rel="nofollow noreferrer">CodeProject</a>, I have encrypted and decrypted file. 
  At the end of the code, I am setting file attribute as <code>Encrypted</code>.</p>
  
  <pre><code>fsIn.Close();
  cs.Close();
  fsCrypt.Close();
  // Mark the file as Encrypted
  File.SetAttributes(outputFile, File.GetAttributes(outputFile) | FileAttributes.Encrypted);
  </code></pre>
  
  <p>and when I am done with decrypt.</p>
  
  <pre><code>// Mark the file Decrypted
  File.SetAttributes(outputFile, File.GetAttributes(outputFile) &amp; ~FileAttributes.Encrypted);
  </code></pre>
  
  <p>And here is how I am checking:</p>
  
  <pre><code>public static bool IsFileEncrypted(string filePath)
  {
     FileAttributes attributes = File.GetAttributes(filePath);
     return (attributes &amp; FileAttributes.Encrypted) == FileAttributes.Encrypted;
  }
  </code></pre>
  
  <p>The problem is, variable <code>attributes</code> shows only <code>Archive</code> attribute. </p>
  
  <p>How I can check whether File is encrypted or not? Is there any other solution?</p>