光棍节程序员闯关秀第9关(总共10关) 解题步骤

本文介绍了解决一个特定的Base64编码谜题的方法。通过替换特殊字符、转换二进制为ASCII字符、解码Base64并最终提取ZIP文件中的图片来找到答案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解题步骤:
1. 应景嘛,把所有的空格替换成 1111
2. 8位二进制转换成一个byte, 解释为 ASCII 字符
3. 得到一个 BASE64 加密的字符串
4. 用 BASE64Decoder 解密
5. 另存为 zip 压缩文件
6. 打开文件,发现里面有一幅图片,图片上的字符串就是 key

代码:
    // 从 D 盘的 code.txt 读取数据,输出到 D 盘的 decode.zip
    public void game1111_9() throws IOException {
        File file = new File("D:\\code.txt");
        BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
        StringBuffer sb = new StringBuffer();
        String line = null;
        while ((line = br.readLine()) != null) {
            String[] codes=line.split(" ");
            for(String code:codes){
                char c=(char) Integer.parseInt(code, 2);
                sb.append(c);
            }
        }
        System.out.println(sb);
        BASE64Decoder decoder = new BASE64Decoder();
        byte[] decodeBuffer = decoder.decodeBuffer(sb.toString());
        File decodeFile = new File("D:\\decode.zip");
        FileOutputStream fileOutputStream = new FileOutputStream(decodeFile);
        fileOutputStream.write(decodeBuffer);
        fileOutputStream.close();
        br.close();
    }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值