Encryption application Program Block Design to support common scenarios of symmetric encryption and hash. Add an application Code And then select the most suitable one. Use the code displayed here along with the scenario or modify it as needed.
Prepare applications
- Add a reference to the encrypted application block assembly. In Visual Studio, right-click the project node in the solution browser, and then clickAdd reference. ClickBrowseGoMicrosoft. Practices. enterpriselibrary. Security. cryptography. dllAssembly. Select the assembly, and then clickOK.
- Set the reference to the Enterprise Library Common Assembly according to the same steps,Microsoft. Practices. enterpriselibrary. Common. dllAnd reference to the objectbuilder assembly,Microsoft. Practices. enterpriselibrary. objectbuilder. dll.
- (Optional) Add the following using Statement (C #) or imports Statement (Visual Basic)Source codeThe top of the file.
C #
Using Microsoft. Practices. enterpriselibrary. Security. cryptography;
Visual Basic
Imports Microsoft. Practices. enterpriselibrary. Security. Cryptography
Note:For visual basic projects, you can use the reference pages of the project designer to manage references and import namespaces. To access the reference page, select a project node in the solution browser.ProjectClickAttribute. When the project designer appears, clickReferenceLabel.
4. Next, add the application code.
The scenario in this section demonstrates how to merge these steps into the application.