Simplified encryption in Microsoft. NET

Source: Internet
Author: User
Tags comments
Applicable:
Microsoft & reg;. NET
Security
Microsoft & reg; Visual Basic & reg;. NET
C #
Abstract: learn how to use the encryption feature of. NET Framework to create a package similar to the one described in this article to protect your data.
Download the sample codes related to CryptoSampleCSSample. msi and CryptoSampleVBSample. msi. (Note that in the example file, the comments of programmers are in English. In this document, the comments are translated into Chinese to facilitate your understanding .)
Directory
Hash overview
Create an example Hash Project
Add the "salt" value to the hash.
Summary
Do you want to save some confidential information on your computer? If yes, this article will show you how to encrypt! Encryption technology is to encode meaningful characters into meaningless characters, so that people who are not supposed to access the data cannot read them. Encryption technology has existed for many years, even before the computer was born. With the emergence of computers, the application of encryption technology in the computer field can generate almost unbreakable code. Microsoft has developed and distributed encryption APIs in Windows 95. With Microsoft. NET, newly created classes can package these complex algorithms into very easy-to-use attributes and methods.
Hash overview
If you only want others to steal your password, you can create a hash for the password data. Hash is a one-way algorithm. Once data is converted, the original value cannot be obtained. Most developers use the database storage password. However, those who search for user data in the database can also see these passwords. However, you can use the hash algorithm to encrypt the password and store it in the database. After the user enters the password, you can use the hash algorithm to decrypt it again, and then compare it with the hash stored in the database. One of the disadvantages of hash is that even if only one small change is made to the original data, the hash of the data will change significantly. The words Pork and Porky are very similar, but the encryption results using the hash algorithm are far different. You may not see any similarities between the two.
. NET developers can use multiple hash algorithm classes. SHA1 and MD5 are commonly used. Next, let's take a look at how to generate a hash for a normal string like "Paul", so that no one can recognize it.

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.