Key Scenarios
This topic describes the most common situations that developers must address when providing cryptography functionality in their applications. Each scenario explains the task, describes a real-world situation where such a task might occur, and includes code that demonstrates how to use the Cryptography Application Block to complete the task. The scenarios are the following:
- Encrypting Data Using a Symmetric Provider. This scenario illustrates how you can use a symmetric algorithm provider to encrypt a secret.
- Decrypting Data Using a Symmetric Provider. This scenario illustrates how you can use a symmetric algorithm provider to decrypt a secret that has been encrypted.
- Obtaining a Hash Value. This scenario illustrates how you can generate a hash value from data.
- Checking Whether a Hash Value Matches Some Text. This scenario illustrates how you can compare plaintext data with a hash value previously generated from the data. By doing this, you can verify that the data has not been changed since the hash was originally generated.
Note
The non-static facade named CryptographyManager replaces the static Cryptographer facade used in previous versions of Enterprise Library. However, code that uses the Cryptographer facade will continue to work in this release. For information about resolving Enterprise Library objects in your applications, see Creating and Referencing Enterprise Library Objects.