Reverse 200 - Sleepless Keith

Writer: Kiernan Dempsey

Keith’s high school has unfortunately made the very bad decision of hosting a CTF right in the middle of standardized testing. And unfortunately, the tests are really messing with Keith’s head, and all the studying they have to do is leaving them almost no time to design problems. That being said, they were able to make one problem for the CTF. Unfortunately, Keith wrote it after losing two nights of sleep to relentless studying. Because of this, the program they wrote was such a mess that the higher-ups actually decided it was too annoying for them to solve, and sent it to our CTF as a prank. It’s...it’s quite a tough one to figure out. Can you figure out what should replace FLAG in order to output "SECRETKEYS".?

...But don’t lose sleep over it, okay?

public class Password
{
    public static String kll1ll1(String zzzzz)
    {
        int jvjj = 0;
        double jyjj = 1.5;
        double jzjj = jyjj+.5;
        double jxjj = jzjj - 1;
        String zzzzzz = "";
        for(int n = 0; n < 10; n++)
        {
            if(n % (jzjj + 3) == 0)
                jvjj += (jxjj + 1);
            else if(n % (jxjj + 4) == 1)
                jvjj += (jzjj + 1);
            else if(n % (jzjj + 3) == 2)
                jvjj -= jxjj;
            else if(n % (jxjj + 4) == 3)
                jvjj *= (2 * jzjj);
            else
            {
                jvjj %= (2*jyjj);
            }
            zzzzzz += zzzzz.charAt(jvjj);
        }
        return zzzzzz;
    }
    public static String kl1ll1l(String xxxxxx)
    {
        int jvjj = 0;
        double jyjj = 2.5;
        double jzjj = jyjj+.5;
        double jxjj = jzjj - 2;
        String xxxxx = "";
        for(int n = 0; n < 10; n++)
        {
            if(n % (jzjj + 2) == 0)
                jvjj += (jxjj + 1);
            else if(n % (jxjj + 3) == 1)
                jvjj += (jzjj + 1);
            else if(n % (jzjj + 4) == 2)
                jvjj -= jxjj;
            else if(n % (jxjj + 1) == 3)
                jvjj *= (2 * jzjj);
            else
            {
                jvjj %= (3*jyjj);
            }
            xxxxx += xxxxxx.charAt(jvjj);
        }
        return xxxxxx;
    }
    public static void main(String[] args)
    {
        String jJjjJjjJ = "FLAG";
        System.out.println(kll1ll1(jJjjJjjJ));
    }
}

results matching ""

    No results matching ""