In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "what are several encryption algorithms commonly used in Java". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
Simple Java encryption algorithms include:
BASE is strictly a coding format, not an encryption algorithm.
MD(Message Digest algorithm)
SHA(Secure Hash Algorithm)
HMAC(Hash Message Authentication Code)
1. BASE
Base is one of the most common encoding methods used to transmit Bit bytecode on the network. You can check RFC~RFC for detailed specifications of MIME. Base encoding can be used to convey longer identifying information in an HTTP environment. For example, in the Java Persistence system Hibernate, Base is used to encode a long identifier (typically a-bit UUID) into a string that is used as a parameter in HTTP forms and HTTP GET URLs. In other applications, it is also often necessary to encode binary data into a form suitable for placement in URLs, including hidden form fields. At this time, the use of Base encoding has unreadability, that is, the encoded data will not be directly seen by the naked eye. (Source Baidu Encyclopedia)
Java implementation code:
2. MD
MD stands for Message-Digest Algorithm, which is used to ensure that information transmission is complete and consistent. It is one of the hash algorithms widely used in computers, and MD has been widely implemented in mainstream programming languages. The operation of data (such as Chinese characters) into another fixed-length value is the basic principle of hash algorithm. MD is the predecessor of MD, MD and MD. Widely used in encryption and decryption techniques, often used for file verification. Verification? No matter how big the file is, MD values can be generated after MD. For example, ISO verification is MD verification. How do I use it? Of course, ISO is passed through MD to produce MD value. Most friends who download linux-ISO have seen MD strings placed next to download links. It is used to verify whether the documents are consistent.
Java implementation:
MD algorithm has the following characteristics:
Compressibility: Any length of data, calculated MD value length is fixed.
Easy to calculate: MD values are easy to calculate from raw data.
Resistance to modification: Any change to the original data, even if only a byte is modified, the MD value obtained is very different.
Weak collision resistance: Given the original data and its MD value, it is very difficult to find a data with the same MD value (i.e. fake data).
Strong collision resistance: It is very difficult to find two different pieces of data that have the same MD value.
MD's role is to allow large amounts of information to be "compressed" into a secure format (i.e., to convert an arbitrarily long string of bytes into a long string of hexadecimal digits) before signing it with a private key using digital signature software. In addition to MD, some of the more famous ones are sha-, RIPEMD and Haval.
Third.SHA
Secure hash algorithm is mainly applicable to Digital Signature Algorithm DSA defined in Digital Signature Standard DSS. SHA produces a one-bit message digest for messages less than ^bits in length. After years of development and improvement by encryption experts, the algorithm has been perfected day by day and widely used. The idea of the algorithm is to take a plaintext and convert it into a (usually smaller) ciphertext in an irreversible way. It can also be simply understood as the process of taking a string of input codes (called premaps or messages) and converting them into a shorter, fixed-digit output sequence of hash values (also called message digests or message authentication codes). The hash function value can be said to be a "fingerprint" or "digest" of the plaintext, so the digital signature of the hash value can be regarded as a digital signature of the plaintext.
Java implementation:
SHA-Comparison with MD:
SHA-and MD are similar to each other because both are derived from MD. Correspondingly, their strengths and other characteristics are similar, but there are also the following differences:
The significant difference is that SHA-digests are longer than MD digests. Using brute force techniques, the difficulty of generating any message with a digest equal to the digest of the given message is an operation of the order of ^for MD and ^for SHA-. In this way, SHA-has greater strength.
Security against cryptanalysis: Because MD is designed to be vulnerable to cryptanalysis attacks, SHA-appears to be less vulnerable to such threats.
Speed: SHA-runs slower than MD on the same hardware.
The fourth is HMAC.
HMAC(Hash Message Authentication Code) is an authentication protocol based on Hash algorithm. The principle of message authentication code is to use public function and key to generate a fixed length value as authentication identifier, and use this identifier to authenticate the integrity of the message. A secret key is used to generate a small fixed-size block of data, known as MAC, which is added to the message and transmitted. The receiver performs authentication and the like using a secret key shared with the sender.
Java implementation code:
"Java commonly used encryption algorithm is what" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.