What is the above code encrypted?

Source: Internet
Author: User
The following code is used to encrypt 7HZ6jHSTbIQwasaXs2J66lXoH95gDSCBwaFOnbWsKfbPGQ % 3D % 3D. how can I use PHP to encrypt or decrypt the code directly? thank you. there are many encryption methods, the most common is md5 and sha. Which of the following codes is encrypted?
7HZ6jHSTbIQwasaXs2J66lXoH95gDSCBwaFOnbWsKfbPGQ % 3D % 3D

How to use PHP to encrypt or decrypt data

Could someone please tell me the full code of PHP? thank you!

------ Solution --------------------
There are many encryption methods, the most common of which is the md5 and sha1 encoding. However, the expression of your code is incorrect. the md5 and sha1 results are basically in lower case, I don't think there will be anyone who is idle and has nothing to do with converting the random code into uppercase. second, the length is incorrect, unless it is encrypted and then cut. therefore, the above two conditions can be ruled out.
In my opinion, the biggest possible reason is the encrypted result of the self-written encryption function, and I guess this string can be reversed.
I remember that discuz has such a function, which is posted for your reference. However, it is difficult to find out how to encrypt it by using only a string of encrypted strings.

PHP code
// Encryption/decryption function (decryption key is required) function passport_encrypt ($ txt, $ key) {srand (double) microtime () * 1000000 ); $ encrypt_key = md5 (rand (0, 32000); $ ctr = 0; $ tmp = ''; for ($ I = 0; $ I <strlen ($ txt ); $ I ++) {$ ctr = strlen ($ encrypt_key )? 0: $ ctr; $ tmp. = $ encrypt_key [$ ctr]. ($ txt [$ I] ^ $ encrypt_key [$ ctr ++]);} return base64_encode (passport_key ($ tmp, $ key);} function passport_decrypt ($ txt, $ key) {$ txt = passport_key (base64_decode ($ txt), $ key); $ tmp = ''; for ($ I = 0; $ I <strlen ($ txt); $ I ++) {$ md5 = $ txt [$ I]; $ tmp. = $ txt [++ $ I] ^ $ md5;} return $ tmp ;}

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.