Development with the Cryptography Application Block
Now that you know about the configuration of the Cryptography Application Block, it's time to dive into actual programming code that demonstrates its simple usage. This section is divided into four scenarios, each of which shows
Development with the Cryptography Application Block
Now that you know about the configuration of the Cryptography Application Block, it's time to dive into actual programming code that demonstrates its simple usage. This section is divided into four scenarios, each of which shows a different use for the application block.
To encrypt sensitive data, you first must configure a symmetric provider as described previously. As soon as you have done that, you can use the method Cryptographer.EncryptSymmetric
for data encryption as shown in Listing 1.
string encryptedData = Cryptographer.EncryptSymmetric(
"Data to encrypt");
As you can see, the first parameter must be the unique name of the symmetric provider you configured through the Configuration Conso