This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15059|Reply: 3

[Source] Java MD5 encryption method

[Copy link]
Posted on 8/27/2018 11:21:07 AM | | | |
1. Overview of MD5 encryption

     Message Digest Algorithm MD5 (Chinese known as Message Digest Algorithm 5th Edition) is a hash function widely used in the field of computer security to provide message integrity protection. The file number for this algorithm is RFC 1321 (R.Rivest, MIT Laboratory for Computer Science and RSA Data Security Inc., April 1992).

MD5 stands for Message-Digest Algorithm 5, which is used to ensure complete and consistent information transmission. It is one of the hash algorithms widely used by computers (also known as summary algorithm and hash algorithm), and mainstream programming languages generally have MD5 implementation. Computing data (such as Chinese characters) into another fixed-length value is the basic principle of the hash algorithm, and MD5 was predecessor MD2, MD3, and MD4.
The MD5 algorithm has the following characteristics:
1. Compressibility: The length of the calculated MD5 value is fixed for any length of data.
2. Easy to calculate: It is easy to calculate the MD5 value from the original data.
3. Modification resistance: Any changes made to the original data, even if only 1 byte is modified, the MD5 value obtained will be very different.
4. Strong collision resistance: The original data and its MD5 value are known, and it is very difficult to find a data with the same MD5 value (i.e., fake data).
The function of MD5 is to allow large amounts of information to be "compressed" into a confidential format (i.e., convert an arbitrary length byte string into a hexadecimal string of a certain length before signing the private key with digital signature software). In addition to MD5, the more famous ones include sha-1, RIPEMD and Haval.

MD5 is an asymmetric encryption algorithm (PS: symmetric encryption means that the password used for encryption and the password used for decryption are the same, and asymmetric means that the key used for encryption and decryption is different)


2. Java implements MD5 encryption and decryption

1. Maven introduces Apache's jar (not a Maven project, go to the next jar on the Internet to manually import)
2. MD5 use code






Previous:Could not autowire. No beans of 'AccountMapper' type found.
Next:Volatile vs. Interlocked vs. lock
Posted on 10/16/2018 7:11:21 PM |
Support, well done
Posted on 1/5/2019 11:55:05 PM |
Yes, this
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com