
CHAPTER 25 ■ CRYPTOGRAPHY
1039
In write mode, the transformation is performed before the data is written to the underlying stream
(as shown in Figure 25-4).
Figure 25-4. Writing and encrypting data
You cannot combine both modes to make a readable and writable CryptoStream (which would have
no meaning anyway). Similarly, the Seek() method and the Position property of the CryptoStream class,
which are used to move to different positions in a stream, are not supported for the CryptoStream and
will throw a NotSupportedException if called. However, you can often use these members with the
underlying stream.
Encrypting Sensitive Data
Now that you’ve ...