Introduction: This is a detailed page of PHP string encryption. It introduces the related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 341726 'rolling = 'no'>
<? PHP // string encryption function for utf8 string function strencryptr4 ($ str_text, $ str_passwd, $ enlevel = 4) {if ($ str_text = ''| $ str_passwd ='') return $ str_text; if ($ enlevel <= 0) $ enlevel = 1; $ text = ''; $ stlen = strlen ($ str_text); $ splen = strlen ($ str_passwd); For ($ I = 0; $ I <$ enlevel; $ I ++) {for ($ J = 0; $ j <$ stlen; $ J ++) {$ text. = CHR (ord (substr ($ str_text, $ J, 1) ^ ord (substr ($ str_passwd, ($ J % $ splen), 1 )));}} $ ai_encryptbox = array (); For ($ I = 0; $ I <256; $ I ++) {$ ai_encryptbox [] = array ($ I, ord (substr ($ str_passwd, ($ I % $ splen ), 1) ;}$ J = 0; $ m = 0; For ($ I = 0; $ I <256; $ I ++) {$ J = ($ J + $ ai_encryptbox [$ I] [0] + $ ai_encryptbox [$ I] [1]) % 256; $ M = $ ai_encryptbox [$ I] [0]; $ ai_encryptbox [$ I] [0] = $ ai_encryptbox [$ J] [0]; $ ai_encryptbox [$ J] [0] = $ M ;}$ J = 0; $ m = 0; $ n = 0; $ str_text = $ text; $ text = ''; For ($ I = 0; $ I <$ stlen; $ I ++) {$ J = ($ J + 1) % 256; $ M = ($ m + $ ai_encryp Tbox [$ J] [0]) % 256; $ n = $ ai_encryptbox [($ ai_encryptbox [$ J] [0] + $ ai_encryptbox [$ m] [0]) % 256] [0]; // $ c = dechex (ord (substr ($ str_text, $ I, 1) ^ $ n); // $ text. = strlen ($ c) = 1? '0 '. $ C: $ C; $ text. = CHR (ord (substr ($ str_text, $ I, 1) ^ $ n);} return base64_encode ($ text);} function strdecryptr4 ($ str_text, $ str_passwd, $ enlevel = 4) {}// end of File
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/341726.html pageno: 6.