Skip to content

Instantly share code, notes, and snippets.

@aemkei
Created July 16, 2012 13:16
Show Gist options
  • Save aemkei/3122658 to your computer and use it in GitHub Desktop.
Save aemkei/3122658 to your computer and use it in GitHub Desktop.
Obfuscate JS
http://www.jsfuck.com/
// RUN THIS IN JAVASCRIPT
([]+{}+[])[!!{}+![]]+([]+
{}+[])[!!{}+!![]]+(!{}+[]
)[!{}+![]]+([][{}]+[])[!{
}+![]]+(!{}+[])[![]+!!{}+
!!{}+!![]]+({}+{})[(!!{}+
!![])*(!!{}+!![])+!!{}]+(
{}-{}+[])[!!{}+![]]+([]+!
!{})[!{}+![]]+([]+!!{})[!
[]+!!{}+!!{}+!![]]+([][{}
]+[])[![]+!!{}+!![]] // !
[Update]: Now with eval(): http://jsbin.com/usumaq/quiet
possible characters: abcdefijlnorstuy NOI []
sample string: obfuscated
undefined = ([][{}]+[])
[object Object] = ({}+[])
false = (!{}+[])
true = ([]+!!{})
NaN = ({}-{}+[])
Infinity = (!!{}/![]+[])
0 = !{}+![]
0 = +!{}
1 = !!{}+![]
1 = +!![]
1 = +!+{}
2 = ![]+!!{}+!![]
2 = !!{}+!![]
2 = +!+[]+!!{}
3 = ![]+!!{}+!!{}+!![]
5 = (!!{}+!![])*(![]+!!{}+!![])+!!{}
o ([]+{}+[])[1]
b ([]+{}+[])[2]
f (!{}+[])[0]
u ([][{}]+[])[0]
s (!{}+[])[3]
c ({}+{})[5]
a ({}-{}+[])[1]
t ([]+!!{})[0]
e ([]+!!{})[3]
d ([][{}]+[])[2]
([]+{}+[])[!!{}+![]]+
([]+{}+[])[!!{}+!![]]+
(!{}+[])[!{}+![]]+
([][{}]+[])[!{}+![]]+
(!{}+[])[![]+!!{}+!!{}+!![]]+
({}+{})[(!!{}+!![])*(!!{}+!![])+!!{}]+
({}-{}+[])[!!{}+![]]+
([]+!!{})[!{}+![]]+
([]+!!{})[![]+!!{}+!!{}+!![]]+
([][{}]+[])[![]+!!{}+!![]]
([]+{}+[])[!!{}+![]]+([]+{}+[])[!!{}+!![]]+(!{}+[])[!{}+![]]+([][{}]+[])[!{}+![]]+(!{}+[])[![]+!!{}+!!{}+!![]]+({}+{})[(!!{}+!![])*(!!{}+!![])+!!{}]+({}-{}+[])[!!{}+![]]+([]+!!{})[!{}+![]]+([]+!!{})[![]+!!{}+!!{}+!![]]+([][{}]+[])[![]+!!{}+!![]]
@aemkei
Copy link
Author

aemkei commented Jul 19, 2012

@tsaniel Damn, I thought I'm the first one who worked that out.
Just got the crazy constructor thing working to get the latest missing chars:

m = (0..constructor+"")[11]

@aemkei
Copy link
Author

aemkei commented Jul 19, 2012

But the tools seems to be broken in Node and Chrome.

Array.prototype.sort called on null or undefined

I guess that's an issue when they try to get "w" using this:

[].sort.call()

In old browsers it returned window but now it doesn't.

Ps: The source of this converter is a bit more readable:
http://discogscounter.getfreehosting.co.uk/js-noalnum.php?txt=%22abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ%22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment