Tags: js 

Rating:

tl;dr
This is a RE chal where the function takes in itself as a string, which prevents us from modifying the function blindly and getting the same output. The program basically does a massive XOR magic and spits out a value which is checked if its printable, if it is then the lock unlocks.
There are 2 solutions, and one of them looks like english words so it is the flag. Some variables and functions are also in cryllic which makes them look identical to other variable/function making it rather confusing

Original writeup (https://github.com/Ariana1729/CTF-Writeups/blob/master/2018/Google%20CTF%20Quals%202018/JS%20Safe%202.0/README.md).