-
-
[求助]php加密算法的问题
-
发表于: 2012-7-25 11:09 2520
-
function decode( $str, $v = "", $k = "p" ) { if ( !empty( $str ) && $v == "k" ) { $str = strtr( $str, array( "_p" => "-", "_o" => "+", "_t" => "=" ) ); $st = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+="; $d1 = 0; $d2 = 0; $d3 = strlen( $str ); while ( isset( $k[$d2] ) ) { $d1 += ord( $k[$d2++] ); } $d4 = $str[$d1 % $d3]; $d5 = strpos( $st, $d4 ); $str = substr_replace( $str, "", $d1 % $d3--, 1 ); $d6 = $d5; $d7 = substr( md5( $k.$d4 ), $d6 % 8, $d1 % 8 + 16 ); $d8 = ""; $d9 = 0; $d10 = 0; $d3 = strlen( $str ); $d11 = strlen( $d7 ); $d2 = 0; for ( ; $d2 < $d3; ++$d2 ) { $d10 = $d10 == $d11 ? 0 : $d10; $d9 = strpos( $st, $str[$d2] ) - $d6 - ord( $d7[$d10++] ); while ( $d9 < 0 ) { $d9 += 64; } $d8 .= $st[$d9]; } return base64_decode( $d8 ); } }
这个是一段加密的过程,现在要做的就是写一个逆向加密的过程,这个算法到$d4那边卡壳了,希望有知道的能给个思路,目的就是求出$str
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!
赞赏
看原图
赞赏
雪币:
留言: