Cyber Apocalypse 2023

Ancient Encodings

Solved by Legend

Challenge description

Your initialization sequence requires loading various programs to gain the necessary knowledge and skills for your journey. Your first task is to learn the ancient encodings used by the aliens in their communication.

In this challenge we were provided a python script named and output.txt file containing the encrypted flag.

from Crypto.Util.number import bytes_to_long
from base64 import b64encode

FLAG = b"HTB{??????????}"

def encode(message):
    return hex(bytes_to_long(b64encode(message)))

def main():
    encoded_flag = encode(FLAG)
    with open("output.txt", "w") as f:

if __name__ == "__main__":

The script is encoding the flag in hex --> base64 to encrypt the flag.

To solve this I used CyberChef with following steps

Published on : 27 Mar 2023