← Back to HWJ CTF

KEYLESS

Reverse a sequence of keyless character transformation math and XOR operations.

Tools Used

PythonReverse Math

Overview

Custom encryption algorithm transforms each character mathematically without using secret keys.

Reconnaissance

Encryption operations: *2, +10, ^42, +5, *3, -7, ^23.

Exploitation Strategy

Apply exact mathematical inverses in reverse order.

Solution Code

def decrypt(ct):
    res = ""
    for ch in ct:
        c = ord(ch) ^ 23
        c = (c + 7) // 3
        c = (c - 5) ^ 42
        c = (c - 10) // 2
        res += chr(c)
    return res

Flag

hwj{you_got_the_flag_correct}