What algorithm is the APPSecret used for authorization generally generated?

Source: Internet
Author: User
When the server authorizes a third party, the party applying for API authorization usually needs to obtain the APPKEY and APPSecret. which algorithms are generally generated based on? If you can, the sample code is better. thank you!

When the server authorizes a third party, the party applying for API authorization usually needs to obtain the APPKEY and APPSecret. which algorithms are generally generated based on? If you can, the sample code is better. thank you!

Reply content:

When the server authorizes a third party, the party applying for API authorization usually needs to obtain the APPKEY and APPSecret. which algorithms are generally generated based on? If you can, the sample code is better. thank you!

Generally, the key and secret of long numbers and letters are generated by md5 and sha1 encryption algorithms.
(Of course, it can also be completely randomly generated, with another uuid algorithm)
The original data may be the id of your account, and the unique value such as the registration time can be combined and then generated through md5 and sha1,

Compared with sha1, md5 is faster than sha1, but sha1 is more powerful than md5. Therefore, in such authorization applications, the sha1 algorithm, such as the oauth signature algorithm, is usually used.

Why does appkey and appsecret ensure the authorization is successful?
For example, if you want to pass three parameters ABC in communication, you need to repeat ABC and appsecret together to get a signature string, and then pass the signature string and appkey together,
In this case, the appkey is used to find the corresponding appsecret, and then the ABC parameter and the queried appsecret are used to create the same signature algorithm. if the obtained signature string is consistent, the authorization is successful.

The key in this process is the confidentiality of appsecret.

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.