Enterprise Library 2.0--Cryptography Application Block

Source: Internet
Author: User
Tags hash

This article includes the following:

1, cryptography Application Block of a simple introduction (refer to the English document with its own)

2, Configure Cryptography Application Block (this article to configure symmetric encryption Provider as an example, the configuration of the Hash Provider is basically similar)

3, how to encrypt a data?

4. Data decryption

5, how to get the data hash value

6, according to the data hash value to determine whether the data changes

Part One: Introduction to crytography Application Block

The Crytography Application Block provides two cryptographic methods: hash and symmetric, the difference being that the hash encryption algorithm is not decrypted, and symmetric can be encrypted and decrypted. Of course it also supports custom encryption methods, and Enterprise Library 2.0 provides the ability to modify and extend cryptographic algorithms.

When do I need to use cryptography Application Block?

When our application needs to use hash or symmetric encryption, we can consider using it, we can use the encryption algorithm provided by Microsoft, or we can define the encryption algorithm we need. When our data needs to be encrypted only, and the decryption method is not used, we can use the hash Provider (for example, if we encrypt the password), we can use the symmetric when the data need to be encrypted and decrypted. Encryption Provider (for example, we can consider using this method to encrypt data when we pass some sensitive parameters through a URL between pages).

Second, crytography Application block to our developers to bring what benefits?

1, it helps our developers to easily solve the encryption problem in the application.

2, it can help us unify the whole enterprise application uniformity.

3, crytography Application Block is extensible, we can use our own Write encryption algorithm to encrypt the application.

Part II: Crytography Application Block Configuration

First we open Enterprise Library Configuration, which exists in the bin directory with your Enterprise Library installation directory. Of course, we need to build our project first and add the app.config file, and I'll follow the example in VS2005 's Test project.

Select File--> Open application, as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.