9
\$\begingroup\$

I had posted an "obfuscated rickroll in Greasemonkey" challenge, which I have deleted in response to Mike Bethany's comment that answers to the question would be of primary use to "spammers." In general, I feel that a primary issue is that of obfuscated JavaScript, so I would like the community's input.

Why should we allow obfuscated JavaScript? JavaScript is a programming language like any other, and code obfuscation is a valid and on-topic challenge on this site. Would we not allow obfuscated Python, Lua, or C#?

Why should we not allow obfuscated JavaScript? JavaScript is essential to many web browser security exploits. It is already hard enough for antivirus software and firewalls to detect malicious payloads obfuscated using common, simple techniques; we shouldn't make it any harder by describing any "new" ways to obfuscate JavaScript code.

Which has more merit?

\$\endgroup\$
1
  • 16
    \$\begingroup\$ We shouldn't allow C either, it can access our hard disk! \$\endgroup\$
    – user11
    Feb 4, 2011 at 16:12

5 Answers 5

27
\$\begingroup\$

I don't believe in security by obscurity.

If the only way (we think) we keep web browsing safe is by "not disclosing" ways to make obfuscated JS, I dare say the black hats are quite a few steps ahead of us.

So, in my personal opinion, you should reopen your question. :-)

\$\endgroup\$
13
\$\begingroup\$

isn't the point of code golf to solve in a few characters as possible?

If so, isn't obfuscation part of the game?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ The original name of this proposal was "Code Golf & Programming Puzzle ". \$\endgroup\$
    – HoLyVieR
    Feb 8, 2011 at 22:09
  • \$\begingroup\$ @HoLyVieR so you are saying that it is also about puzzles? so? can you expand on your point? \$\endgroup\$
    – cbrulak
    Feb 8, 2011 at 22:47
  • \$\begingroup\$ Nevermind, I misread what you said. \$\endgroup\$
    – HoLyVieR
    Feb 9, 2011 at 3:54
6
\$\begingroup\$

If you can run in a sand box, either one of your own or one someone else maintains on the internet, the question of malicious code becomes less of an issue (note I generally don't run anything from this site until I have a vague idea what it is up to).

\$\endgroup\$
2
  • \$\begingroup\$ The JavaScript sandbox is not impenetrable, as new security exploits are regularly discovered. In fact, Mozilla just released an update to Firefox to patch some holes. mozilla.org/security/announce \$\endgroup\$ Mar 2, 2011 at 21:48
  • \$\begingroup\$ @idealmachine: Of course. You're not going to be able to run unknown code with no risk. \$\endgroup\$ Mar 2, 2011 at 22:29
4
\$\begingroup\$

I think we should allow it. You can always run the code through jsBeautifier, which unobfuscates the code.

\$\endgroup\$
1
  • \$\begingroup\$ Note that a beautifier will not de-obfuscate any code with any effort put into obfuscation at all. It can just do some basic pattern recognition and spaces. \$\endgroup\$
    – mousetail
    Nov 16, 2022 at 17:05
-2
\$\begingroup\$

PLEASE I'm begging you DON'T MAKE IT impossible for US LANGUAGE DESIGNERS OVER HERE not to osmotically acquire biases toward the PRIMARY-MAINSTREAM-WORLDSTANDARD code-look/syntax

Also, I have friends who are C-as-an-assembly-type purists that just decided to learn JSEc(s)maScript[TM] completely from scratch (like they refuse to even view-source anywhere til then) as a race next Summer, and I'd be surprised if they don't do challenges here,

I know there's not a lot of us who post onobfuscated only under click to view hider "folds", but I only hang out here because there are so many people who end up being so creatively cool in different ways to each-others' differently-selected personal learningstyles.

Thanks!

\$\endgroup\$
1
  • \$\begingroup\$ Are you a language designer? That's coo. What language are you working on? \$\endgroup\$
    – mousetail
    Nov 16, 2022 at 17:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .