MD5 Message Digest algorithm

Source: Internet
Author: User

Messages Digest 5 (Message digest algorithm) is a hash function widely used in the field of computer security to provide integrity protection for messages.

MD5 's role is to allow bulk information to be "compressed" into a confidential format before signing a private key with a digital signature software, which is to transform an arbitrary-length byte string into a long hexadecimal string.

Features of the MD5 algorithm:

1. compressibility: Any length of data, the calculated length of the MD5 value is fixed.

2. Easy to calculate: It is easy to calculate the MD5 value from the original data.

3. Anti-modification: Make any changes to the original data, even if only one byte is modified, the resulting MD5 value will be greatly different.

4. Strong anti-collision: known raw data and its MD5 value, it is very difficult to find a data with the same value (that is, forged data).

1  Private Static stringMd5digest (stringinput)2     {3         stringresult ="";4         if(Input. Length >0)5         {6             byte[] Original =Encoding.Default.GetBytes (input);7MD5 S1 =MD5. Create ();8             byte[] Change =S1.computehash (original);9result = bitconverter.tostring (change). Replace ("-",string. Empty);Ten         } One         returnresult; A}

MD5 Message Digest algorithm

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.