Programming with .NET Asymmetric Cryptography
In this section, we look at the RSAAlgorithm and SavingKeysAsXml example programs provided for this chapter. These two code examples show how to encrypt and decrypt using the RSA algorithm as well as how to store and retrieve key information using an XML format. The RSA code example uses the concrete RSACryptoServiceProvider class. Figure 4-2 shows where this class resides in the class hierarchy, under the abstract AsymmetricAlgorithm class. The other concrete class, DSACryptoServiceProvider, is discussed in Chapters 5, where we look at digital signatures.
Figure 4-2. The asymmetric algorithm class hierarchy.
An RSA Algorithm Example
The RSAAlgorithm example uses the Encrypt method of the RSACryptoServiceProvider ...