Operating on Streams: CryptoStreams and ICryptoTransforms

A common scenario for developers is the application of cryptographic transforms to a stream of binary data, such as encrypting data about to be written to an on-disk file or a network connection. The .NET Framework cryptography classes make it very easy to perform these sorts of operations using the CryptoStream class and objects implementing the ICryptoTransform interface. We first describe the ICryptoTransform model block transforms and then show how these transforms can be “wrapped” around any stream in the .NET Framework using the CryptoStream class.

Figure 30.10 shows the basic model of an ICryptoTransform. An ICryptoTransform represents any blockwise mathematical transformation, ...

Get .NET Framework Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.