CryptoStream - Read vs Write - Is there any difference?

206 Views Asked by At

Is there any change in the code needed between if we use CryptoStream with CryptoStreamMode.Read or with CryptoStreamMode.Write ?

(Besides reading from it and writing to an outStream or reading from an inStream and writing to the CryptoStream, of course.)

.

.

If you absolutely need to see code, here's some (See end of 3rd line):

using (Aes aes = Aes.Create())
using (ICryptoTransform encryptorTransform = aes.CreateEncryptor())
using (CryptoStream outAesStream = new CryptoStream(outStream, encryptorTransform, CryptoStreamMode.Write))
{
   //...
}
0

There are 0 best solutions below