jasec-算法逆向
function encode( $str = '' ){
$strrev = strrev( $str );
$string = '';
for( $i=0; $i < strlen($strrev);$i++ ){
$char = substr( $strrev, $i, 1 );
$ordChar = ord( $char ) + 1;
$char = chr( $ordChar );
$string = $string.$char;
}
$string = base64_encode( $string );
$string = strrev( $string );
$string = str_rot13( $string );
return $string;
}
密文: ==jEgWTn8kJrRyRFBuKJLuzH1LmDTAzs
首先把密文用Converter工具Rot13后得:
==wRtJGa8xWeElESOhXWYhmU1YzQGNmf
import base64 str = "==wRtJGa8xWeElESOhXWYhmU1YzQGNmf" flag = base64.b64decode(str) print(flag)
运行后得到base64解码后的值为"~cFC65RhXYxNHIDyl|hbmG"
flag = "~cFC65RhXYxNHIDyl|hbmG" for i in flag: print(chr((ord(i)-1)),end="")
得到:}bEB54QgWXwMGHCxk{galF
a = "}bEB54QgWXwMGHCxk{galF" print(a[::-1])
得到flag