Cyber Apocalypse 2025

Coding Summoners Incantation It is a fairly simple task. The aim is to choose a number of tokens with the maximum possible sum. The twist is that we cannot use a token next to one that we’ve already chosen. To solve it, we can create a recursive search with the following constraints: if there are no tokens left, the max sum is 0 if there’s one token left, the max sum is the value of that token otherwise, we can check the first two tokens to decide which one we should use we take the 1st one and call the recursive function with the remaining ones (making sure to remove the 2nd token, since that’s the neighbor we cannot use) repeat previous step with the 2nd token; now we have to remove the 1st and 3rd tokens choose the one that has the higher sum def find_max_energy(tokens): if len(tokens) == 0: return 0 elif len(tokens) == 1: return tokens[0] e1 = tokens[0] + find_max_energy(tokens[2:]) e2 = tokens[1] + find_max_energy(tokens[3:]) return max(e1, e2) input_text = input() tokens = [int(t) for t in input_text[1:-1].split(',')] print(find_max_energy(tokens)) Dragon Fury For this task, we get a 2d array that contains possible “damage values” for rounds, and a target we need to reach. Our aim is to select a single value for each round in a way that adds up to our target in the end. ...

April 16, 2025 · 17 min · pshegger

IrisCTF 2024

IrisCTF has just ended, and since I was one of the participants, I decided to write a few thoughts about it, as well as write proper writeups for the challenges I managed to solve. As a start, let’s go through the challenges by categories, and in the end, I’ll add some personal thoughts. Cryptography Baby Charge For this challenge, we got access to the source code for a custom cipher. At startup, it generated a random key and nonce, and after that, there were two options for the user: ...

January 8, 2024 · 15 min · pshegger

h@cktivitycon 2021 CTF

This year’s h@cktivitycon was held last Saturday, but even before it started, there was another event HackerOne had organized: this year’s CTF. It began on Thursday and ran for 48 hours. As I wasn’t following the events, it was already Friday when I realized it was running. I still had a bit more than a day to complete as many challenges as possible, so I decided to register and see how it goes. ...

September 20, 2021 · 15 min · pshegger