About SHA1 's knowledge

Source: Internet
Author: User
Tags sha1

When you look at Pro git 2, there's This passage:
The mechanism that Git uses for this checksumming is called a SHA-1 hash. This was a 40-character string composed of hexadecimal characters (0–9 and a–f) and calculated based on the contents of a F Ile or directory structure in Git. A SHA-1 Hash looks something like this:
24b9da6552252987aa493b52f8696cd6d3b00373
You'll see these hash values of all over the place in Git because it uses them so much.in fact, Git stores everything in it database not by file name is the hash value of its contents.

This aroused, my interest in SHA1, the encyclopedia a bit.
1) SHA1, i.e.Secure Hash Algorithm 1, Secure Hash Algorithm 1
2) for messages with a length less than 2^64 bits, SHA1 will produce a160-bit message digest。 When a message is received, this message digest can be used to verify the integrity of the data. As the data is likely to change during transmission, a different message digest is generated. SHA1 has the following characteristics:You cannot restore information from a message digest; two different messages do not produce the same message digest
3) SHA1 alwaysTreat the message as a bit string
4) in the SHA1 algorithm, we must convert the original message (string, file, etc.) into a bit string. The SHA1 algorithm only accepts bits as input
5)the message must be interpolated, so that the remainder of its length after modulo 512 is 448. That is, (the message length after the complement)%512 = 448. Even if the length has been satisfied with 512 modulo after the remainder is 448, the complement must also be carried out.
6)message must be complement length, the complement length is the length of the original data that is appended to the message after the complement operation has been performed. Typically, a 64-bit data is used to represent the length of the original message. If the message length is less than 2^64, then the first word is 0. If the original message is longer than 512, we need to fill it in multiples of 512. We then divide the entire message into a 512-bit block of data, processing each block of data, to get a message digest.
7) SHA1 is widely used in many security protocols, including TLS and SSL, PGP, SSH, S/MIME, and IPSec, which were once considered successors to the MD5 (previously widely used hash function).

About SHA1 's knowledge

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.