Cyber Apocalypse 2024


Solved by : Starry-lord

This challenge comes with an output.txt and a python source as you can see below:

    from secret import FLAG
    from random import randint
    def to_identity_map(a):
        return ord(a) - 0x41
    def from_identity_map(a):
        return chr(a % 26 + 0x41)
    def encrypt(m):
        c = ''
        for i in range(len(m)):
            ch = m[i]
            if not ch.isalpha():
                ech = ch
                chi = to_identity_map(ch)
                ech = from_identity_map(chi + i)
            c += ech
        return c
    with open('output.txt', 'w') as f:
        f.write('Make sure you wrap the decrypted text with the HTB flag format :-]\n')

We needed to write a decryption mechanism for this, taking the output file as input. Here’s my solution:

Published on : 16 Mar 2024