A friend at work came to me pissed off one day because a colleague from another team “stole” his code to work on his own things. While i decided to not dive into the moral argument there, i was eager to write something which would have technically solved that problem.
The eval() function is available in most popular programming languages, it converts a string into executable code (quite cool!). Why not combine that with encryption? That way, as a developer, you are pushing code that works, so your company is happy (maybe not because i can easily understand why any company would ban this, but who cares) and your code is only accessible to you because you know the password (and hopefully you don’t include it along with the encrypted code you’re pushing to git).
Open index.html
Access functionalities or parts of code you decided to hide with your own passwords
I think this small program is quite cool. I used it to encrypt keys that sometimes services require you to have inside your code. I didn’t check if there’s other structurally better ways to solve this problem, I’m sure there are, and this is just a hack. But i used it and it worked and it’s fairly simple.