For more PACTF write-ups, [check this out](https://leniumc.github.io/categories/CTF/).
We can easily figure out that the text file was in a language called JSFuck. Using an online decoder, we get this message.
```Congrats! You've uncovered the truth. Now go here: ibarakaiev.shpp.me/pactf_s7fj43/ai.zip```
From the given URL, we obtain [this](ibarakaiev.shpp.me/pactf_s7fj43/ai.zip) file. Looking through all of the files in the zip, there is one named ```script.js``` .
There was this line of code.``` javascriptappend_ai('The key is now stored securely in ("http://ibarakaiev.shpp.me/pactf_s7fj43/key_%d.txt", get_key_number(6, [16, 23, 16, 15, 42, 8])).', 30, 300);```
And this function.``` javascript// this function returns the number needed to access key_%d.txtfunction get_key_number(n, arr) {    // TODO: implement solution to the following problem
    /**     * You are given a sequence _s_ consisting of _N_ integers. You can divide it to      * two sequences _p_ and _q_ such that every element of your sequence belongs exactly     * to one of these sequences.      *     * Let _B_ be the sum of elements belonging to _p_, and _C_ be the sum of elements     * belonging to _C_. Note: if some of the sequences is empty then its sum is 0).     * What is the maximum possible value of _B_ - _C_      */}```
Looking at the function description, we find that the integer in the file name ```key_%d.txt``` must be the sum of ```[16, 23, 16, 15, 42, 8]```, which is 120. Going to that website, we obtain another text file.
```But you'll have to decrypt it first! The following text is displayed using byfes (it's like bytes but only 5 bits).
mrxwozAp
PACTFSCII is as follows (it's like ASCII but for PACTF). PACTF system only accepts ASCII characters, however.0  - a1  - b2  - c3  - d4  - e5  - f6  - g7  - h 8  - i 9  - j10 - k11 - l12 - m13 - n14 - o15 - p16 - q17 - r18 - s19 - t20 - u21 - v22 - w23 - x24 - y25 - z26 - P27 - A28 - C29 - T30 - F31 - \0```
Representing the given text in ```byfes``` in binary form, and we obtain this result.
```01100 10001 10111 10110 01110 11001 11011 01111```
Recombining these binary numbers in groups of 8 and converting each group to an ascii character reveals the flag.
```doggo```