This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
|The latest Enterprise Library information can be found at the Enterprise Library site.|
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.
If you use the Unity Integration approach to create instances of objects from the Cryptography Application Block, you must use the non-static façade named CryptographyManager. This class exposes the same API as the Cryptographer class static façade. For more information about using the Unity Application Block to create and inject instances of Enterprise Library objects, see Creating Objects Using the Unity Application Block.