列表

详情


decrypt

平台   WEB   已通过

题目作者: 未知

一  血: ‌‌‌‌‌dotast

一血奖励: 3金币

解  决: 1271

提  示:

描  述: Flag:{xxx} fR4aHWwuFCYYVydFRxMqHhhCKBseH1dbFygrRxIWJ1UYFhotFjA=

附  件: 下载

站长题解:

<?php
function encrypt($data,$key)
{
    $key = md5('ISCC');
    $x = 0;
    $len = strlen($data);
    $klen = strlen($key);
    for ($i=0; $i < $len; $i++) { 
        if ($x == $klen)
        {
            $x = 0;
        }
        $char .= $key[$x];
        $x+=1;
    }
    for ($i=0; $i < $len; $i++) {
        $str .= chr((ord($data[$i]) + ord($char[$i])) % 128);
    }
    return base64_encode($str);
}

// 解密函数
function decrypt($base64_str = 'fR4aHWwuFCYYVydFRxMqHhhCKBseH1dbFygrRxIWJ1UYFhotFjA=')
{
    $key = md5('ISCC');
    $x = 0;
    $data = base64_decode($base64_str);
    $len = strlen($data);
    $char = '';
    $str = '';
    $klen = strlen($key);
    for ($i=0; $i < $len; $i++) { 
        if ($x == $klen)
        {
            $x = 0;
        }
        $char .= $key[$x];
        $x+=1;
    }
    for ($i=0; $i < $len; $i++) {
        if (ord($data[$i]) > ord($char[$i])) {
            $str .= chr(ord($data[$i]) - ord($char[$i]));
        }
        else{
            $str .= chr (128+ord($data[$i])-ord($char[$i]));
        }
        print($str."\n");
    }
}

decrypt();

?>

去做题

enderman @ 2024-01-07 23:21:28 👍0

flag固定38 就是逆运算 东西不难 花点时间就能搞出来


enderman @ 2024-01-07 23:21:28 👍0

太长放不了 只能压缩以后发出来了


enderman @ 2024-01-07 23:21:28 👍0

function decrypt($in){$char='729623334f0aa2784a1599fd374c120d729623';for ($i=0; $i < 38; $i++) {$char_a[] = ord($char[$i]);$s.= chr((ord(base64_decode($in)[$i])-$char_a[$i]+128)%128);}return $s;}


EtHat @ 2023-12-07 23:21:28 👍0

Flag:{asdqwdfasfdawfefqwdqwdadwqadawd}


zzccbb2005 @ 2023-12-07 23:21:28 👍0

https://blog.csdn.net/YouthBelief/article/details/124250084 Flag:{asdqwdfasfdawfefqwdqwdadwqadawd}


XRain @ 2023-10-07 23:21:28 👍0

有个小坑,-10%20 这条表达式在 PHP 中的结果是 -10,而 python 的结果是 10,也就是 python 对于负数的取模会将其转换为正数。如果 PHP 像 python 那样处理,直接粘贴 encrypt() 函数的代码,在前面加一句 base64_decode() 就完事了。


wxy1343 @ 2023-06-07 23:21:28 👍0

for i in range(38): s[i] = data[i] + (128 if data[i] < ord(key[i % len(key)]) else 0) - ord(key[i % len(key)])


xiaxia14641 @ 2023-06-07 23:21:28 👍0

Flag:{asdqwdfasfdawfefqwdqwdadwqadawd}


xx3125062 @ 2023-06-07 23:21:28 👍0

str1 = "fR4aHWwuFCYYVydFRxMqHhhCKBseH1dbFygrRxIWJ1UYFhotFjA=" key = "729623334f0aa2784a1599fd374c120d729623" aaa = [] print(len(str1)) print(len(base64.b64decode(str1))) for i


haoge2023 @ 2023-06-07 23:21:28 👍0

<?php $key = md5('ISCC'); $b64='fR4aHWwuFCYYVydFRxMqHhhCKBseH1dbFygrRxIWJ1UYFhotFjA='; $str=base64_decode($b64); $x = 0; $len=38; $klen=32; $char=''; for ($i=0; $i < $len; $i++) {