window.onload=function(){ /*页面加载完成之后生成博客目录*/ BlogDirectory.createBlogDirectory("cnblogs_post_body","h2","h3",20); }

[LitCTF 2023]我测你vva

题目分数:455

题目标签: java审计单表置换

题目描述:

- 题目描述:听说你会Java?那这题你应该能做出了叭?逆推一下算法就行啦!
- 出题人:J_0k3rflag以NSSCTF{}形式提交
package test;

public class Decrypto{
    public static void main(String[] args) {
        String cipher="HYEQJvPZ~X@+Bp";
        int plain;
        char[] arr;
        arr=cipher.toCharArray();
        for(int i=0; i<cipher.length(); i++) {
           if(i%2==0){
            plain=Integer.valueOf(arr[i]);
            plain=plain-i;
            System.out.print((char)plain);
           }
           if(i%2!=0){
            plain=Integer.valueOf(arr[i]);
            plain=plain+i;
            System.out.print((char)plain);
           }
        }
    }
}
posted @ 2023-05-15 17:51  Kicky_Mu  阅读(44)  评论(0编辑  收藏  举报