encryption-activated
Files:
This was a slightly confusing crypto challenge that wrecked my pea-sized brain (to be fair, I misunderstood the encryption script for a good 1/2 hour).
The Challenge
We are given a Python file that is slightly complicated:
The encryption function first sets a global variable myletter
and set an initial ASCII offset. The function modifies each character in the input by an incremental ASCII value and added the value of myletter
to it. Each modification results in myletter
being incremented by 1 in ASCII, thus, creating an increasing offset per character.
The output file looked a little goofy in my text editor:
The Thought Process
Since there are only 128 ASCII codes, we can easily brute force the initial value and reverse the operations. Reversing the operations gave me a huge headache but its ok.
This snippet simply does the reverse of every operation in the encryption algorithm (duh…) but also just skips to the next ASCII if there are any errors during the transformation.
The Flag
Sifting through all the output, it seems that the ASCII value of 32
returned comprehensible English, which if we wrapped it around NICC{}
, returned the flag.
Flag: NICC{WAt_dO_yOu_tHINk_of_My_cIpHer}
In hindsight, I think the lack of solves can be attributed to people missing the flag in the output or getting stuck on the encryption logic but oh well! You learn something new every day :)