title: CryptoStream: Why CryptoStreamMode.Write to encrypt and CryptoStreamMode.Read to decrypt?
body: <p>Let e = 'password' and I am transforming it to 'as9kio0736' in a CryptoStream.</p>
  
  <p>Let d = 'as9kio0736' and I am transforming it to 'password in a CryptoStream.</p>
  
  <p>When I am transforming d back to 'password' why is it not considered writing in a CryptoStream?</p>
  
  <pre><code>using (MemoryStream msEncrypt = new MemoryStream()) {
      using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write)) {
          using (StreamWriter swEncrypt = new StreamWriter(csEncrypt)) {
              swEncrypt.Write(plainText);
          }
      }
  }
  
  using (MemoryStream msDecrypt = new MemoryStream(cipherText)) {
      using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) {
          using (StreamReader srDecrypt = new StreamReader(csDecrypt)) {
              plaintext = srDecrypt.ReadToEnd();
          }
      }
  }
  </code></pre>