Shabak Challenge — Part 2: Like a Boss
Danny Povolotski
34

Hiya danny

I come here after googling, I actually managed all the steps of Shabak’s challange up until Challange 3…

my code for challange 2 is basicailly around this (only this version is modded for challange 3):

as you can see I use the aforementioned struct (I renamed it on my case for simplicity) and I use it to “decode” the operation I need to do, I also wrote the files manually (yeah… lol on that… I started getting random NULLS on fopen [which visual redirected me to use fopen_s], fopen was easier under linux… not much of experience with visual studio progrmming, in a nutshell I hate it) and I run through it.

if you take a look at my main function you will see the way I am bruteforcing it, and like I thought running so many loops would take years before I can get a result (I piped it into a file named file.txt), now I did run it in the hope they figured bruteforce has it’s cons (time) and rendered an easier code for bruteforcing…

but that’s not the case, I can wait for about 17H (calculated time for program to finish) but that’s not guranteed to work since my brute force is calculating every option, I figured that running SUB with SUB after it is like running 1 “BIG SUB” so I thought it’s obsolete, and there are only “3 operations” in our new key, so I figured I’d try each combination in unique way….

even now I think I am doing something wrong — I do write those functions in a primitive kind of a way, I did read the hint you gave Gal on the permutations… I thought about it — you are right however

how can I ‘score’ permutations? the last “step” of the key could be XOR, it could change EVERYTHING in readbility, I can count the minimal character number and the maximal and see if it’s in range of the ASCII table for ‘.’ ‘?’ and a-zA-Z but figuring out XOR could ruin this calculations this seems obselete, if I can’t “score” permutations (which if I do I need to somehow put them inside a dynamic array in C, possibliy will need to include vector) I can’t move to the third step…