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 ;}