Summary of definitions and usage of the sha1 () function in php

Source: Internet
Author: User
Tags crypt sha1 encryption
PHP encryption function-sha1 () function encryption first we will first introduce what is sha1? The full name of sha is: SecureHashAlgorithm (Secure Hash Algorithm) is mainly applicable to the digital signature algorithm defined in DigitalSignatureStandardDSS ). For messages with a length less than 2 ^ 64-bit, SHA1 generates a 160-bit message digest. When we receive the encryption function-sha1 () of the... PHP encryption function, we will first introduce what is sha1? The full name of sha is: Secure Hash Algorithm (Secure Hash Algorithm) is mainly applicable to Digital Signature Algorithm DSA defined in Digital Signature Standard DSS ). For messages with a length less than 2 ^ 64-bit, SHA1 generates a 160-bit message digest. When a message is received, the message digest can be used to verify data integrity. Data may change during transmission, so different message summaries are generated at this time. The sha1 () function provided by PHP uses the SHA algorithm! The two articles I introduced earlier, "encryption of PHP encryption functions-encryption of crypt () functions" and "encryption of PHP encryption functions-md5 () functions", I believe everyone has a certain understanding of encryption, in this chapter, we will continue to introduce sha1 () function algorithms similar to MD5 () functions. The syntax format of the sha1 () function is as follows:

1. PHP encryption function-sha1 () function-encrypted instance usage

Introduction: SHA algorithms are similar to MD5 in php encryption technology. SHA is called Secure Hash Algorithm (Secure Hash Algorithm). The sha1 () function provided by PHP uses the SHA Algorithm.

3. PHP encryption technology

Introduction: PHP encryption technology: I learned some knowledge about PHP encryption a few days ago. now I will summarize several encryption forms in PHP: Md5 () encryption algorithm Crypt () encryption algorithm Sha1 () encryption Algorithm URL encoding encryption technology Base64 encoding encryption technology Md5 () encryption algorithm syntax: string md5 (string $ str [, bool $ raw_output = false]) $ str: optional original string (not commonly used)

4. how to correctly implement PHP to generate a unique identifier _ PHP Tutorial

Introduction: how to correctly generate a unique identifier in PHP. Today, we will introduce in detail the sample code for generating a unique identifier in PHP :? // Generate a unique identifier // sha1 () function, security hash algorithm (SHA1) functioncreate_uniq

5. c # different solutions to SHA1 encryption results from PHP

Introduction: c # different from the SHA1 encryption results in PHP solutions found the SHA1 encryption results written in c # and the sha1 () in PHP that day during API debugging () the reason for finding the difference is that most of the Help documentation provided is the PHP method during interface debugging. net. The most typical problem is that token does not pass the verification and now provides a SHA1 method with the same result as Php.

6. how to correctly generate a unique identifier in PHP

Introduction: how to correctly generate a unique identifier in PHP. Today, we will introduce in detail the sample code for generating a unique identifier in PHP :? // Generate a unique identifier // sha1 () function, security hash algorithm (SHA1) functioncreate_uniq

7. how do you encrypt your password stored in the database using php?

Summary: It is said that md5 is not secure. it seems that it is more secure to use sha1 () for encryption, and even a bcrypt algorithm. how do you choose phper?

8. PHP encryption function in PHP Tutorial

Brief introduction: the basic principle of data encryption is to process the original plaintext files or data in a certain algorithm to make it unreadable, usually called "ciphertext ", in this way, we can prevent unauthorized data theft and reading. PHP encryption functions include: crypt (), md5 (), and sha1 (), as well as the encrypted extended libraries Mcrypt and Mas.

[Related Q & A recommendations ]:

Sha1-python multi-byte big number calculation problem

How do you encrypt your password stored in the database using php?

The above is the detailed description of the definition and usage of the sha1 () function in php. For more information, see other related articles in the first PHP community!

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.