To find out what this code is encrypted with.

Source: Internet
Author: User
Tags sha1
Ask what the following code is encrypted by
7hz6jhstbiqwasaxs2j66lxoh95gdscbwafonbwskfbpgq%3d%3d

How to encrypt or decrypt with PHP

Trouble who knows the big brother directly to PHP complete code, thank you

------Solution--------------------
There are many kinds of encryption, the most common is MD5 and SHA1 coding, but you this string of code performance is not correct, whether it is MD5 or SHA1 out the results are basically lowercase, I think there is no good man idle to the code of the randomness of the transfer into uppercase bar. followed by the length is not right, Unless it is encrypted and then cut. So basically you can rule out both of these conditions.
I think the biggest possibility is to write the encryption function after the result of encryption. And I guess this string is probably back in reverse.
Remember Discuz there is such a function, posted out for you to refer to. But it is difficult to know what technique he uses to encrypt a string of encrypted strings.

PHP code
//encryption/decryption function (to know decryption key to decrypt) 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 = $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 + +) {$MD 5 = $txt [$i];    $tmp. = $txt [+ + $i] ^ $MD 5; } return $tmp;} 
  • Related Article

    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.