Authcode-PHP development, the encryption and decryption function of Discuz

Source: Internet
Author: User
Authcode () is not a built-in function of PHP. It is a function developed by KANG Sheng that uses exclusive or operations for encryption and decryption. It can be said that this is a major contribution of KANG Sheng to the PHP community in China. KANG Sheng's own products, such as Discuz and UCenter, and many Chinese companies that use PHP use this function for encryption. In the previous section, inkPHP3.1.2 integrated UCenter details (4), authcode () plays an important role in synchronous login. During synchronous login (from project login to UCenter), Authcode() It is not a built-in function of PHP. It is a function developed by KANG Sheng that uses exclusive or operations for encryption and decryption. It can be said that KANG Sheng has made a significant contribution to the PHP community in China. KANG Sheng's own products, such as Discuz and UCenter, and many Chinese companies that use PHP use this function for encryption. Previous ThinkPHP3.1.2 comprehensive UCenter explanation (4)Synchronous login in progress Authcode() Plays an important role. During synchronous login (from project login to UCenter), authcode () encrypts user login information because unencrypted data is easily intercepted during transmission, in this way, the user information is exposed. The role of authcode () is to provide encryption protection for the transmitted data. When the data arrives at the terminal (UCenter), authcode () decrypts the encrypted data to restore the data.


The following program demonstration gives us a better understanding of authcode () and the principles of synchronous logon.


 

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.