Based on @VisioN's profile signature in StackOverflow, turned into a configurator that anyone can use.
Last active
November 4, 2024 11:03
-
-
Save jasonsperske/5400283 to your computer and use it in GitHub Desktop.
JavaScript Obfuscator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
#obfuscated { | |
width: 100%; | |
height: 350px; | |
} | |
</style> | |
<input id='input' value='I love you'/> | |
<button id='obfuscate'>obfuscate</button> | |
<br/> | |
<textarea id='obfuscated'></textarea> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script> | |
var obfuscateMap = { | |
'a': ['(([]===[])+/-/)[1]'], | |
'b': ['(1+{})[(1<<1)+1]'], | |
'c': ['(1+{})[1+11>>>1]','(-{}+{})[-1+1e1-1]'], | |
'e': ['([]+![])[1<<1<<1]','([,][~1]+[])[1-~1]'], | |
'f': ['([]+/-/[(!!1+[])[1>>1]+(!!1+[])[1<<1^1]+(!1+[])[1|1<<1]+(!!1+[])[1^1]])[1^1]'], | |
'i': ['/\\[[^1]+\\]/[([]+![])[1<<1<<1]+(/|/[(1+{})[1+11>>>1]+[[]+{}][+!1][1]+([]+1/[])[1<<1>>1]+([1<1]+[])[1+11>>>1+1]+[[!!1]+1][+[]][1-1]+([]+!!/!/)[1|1]+(/1/[1]+[])[!1%1]+(-{}+{})[-1+1e1-1]+(1+[!!1])[1]+([]+1+{})[1<<1]+[!!/!!/+[]][+[]][1&1]]+/=/)[1e1+(1<<1|1)+(([]+/-/[(!!1+[])[1>>1]+(!!1+[])[1<<1^1]+(!1+[])[1|1<<1]+(!!1+[])[1^1]])[1^1]==+!1)]+(!![]+{})[1|1<<1]+[1+{}+1][!1+!1][(11>>1)+1]](([]+/-/[(!!1+[])[1>>1]+(!!1+[])[1<<1^1]+(!1+[])[1|1<<1]+(!!1+[])[1^1]]))[1&.1][(11>>>1)-1]'], | |
'I': ['[[]+1/!1][1^1][1>>1]'], | |
'j': ['(1+{})[1<<1+1]'], | |
'l': ['([]+!!-[])[1<<1]'], | |
'n': ['([]+1/[])[1<<1>>1]'], | |
'o': ['[[]+{}][+!1][1]','([]+1+{})[1<<1]','[/~/+{}][+!1][-~1<<1]','[[],[]+{}][1<<1>>>1][1||1]'], | |
'O': ['[[]+{}][+!1][(1<<1<<1)+(1<<1<<1)]','[[]+{}][+!1][(1<<1<<1<<1)]'], | |
'r': ['([]+!!/!/)[1|1]','[!!/!!/+[]][+[]][1&1]'], | |
's': ['([1<1]+[])[1+11>>>1+1]'], | |
't': ['[[!!1]+1][+[]][1-1]','(1+[!!1])[1]'], | |
'u': ['(/1/[1]+[])[!1%1]','(/[<+>]/[1&1|1]+[1.1])[1/11.1&1.11]'], | |
'v': ['/\\[[^1]+\\]/[([]+![])[1<<1<<1]+(/|/[(1+{})[1+11>>>1]+[[]+{}][+!1][1]+([]+1/[])[1<<1>>1]+([1<1]+[])[1+11>>>1+1]+[[!!1]+1][+[]][1-1]+([]+!!/!/)[1|1]+(/1/[1]+[])[!1%1]+(-{}+{})[-1+1e1-1]+(1+[!!1])[1]+([]+1+{})[1<<1]+[!!/!!/+[]][+[]][1&1]]+/=/)[1e1+(1<<1|1)+(([]+/-/[(!!1+[])[1>>1]+(!!1+[])[1<<1^1]+(!1+[])[1|1<<1]+(!!1+[])[1^1]])[1^1]==+!1)]+(!![]+{})[1|1<<1]+[1+{}+1][!1+!1][(11>>1)+1]](([]+/-/[(!!1+[])[1>>1]+(!!1+[])[1<<1^1]+(!1+[])[1|1<<1]+(!!1+[])[1^1]]))[1&.1][11>>>1]'], | |
'x': ['[([]+![])[1<<1<<1]+(/|/[(1+{})[1+11>>>1]+[[]+{}][+!1][1]+([]+1/[])[1<<1>>1]+([1<1]+[])[1+11>>>1+1]+[[!!1]+1][+[]][1-1]+([]+!!/!/)[1|1]+(/1/[1]+[])[!1%1]+(-{}+{})[-1+1e1-1]+(1+[!!1])[1]+([]+1+{})[1<<1]+[!!/!!/+[]][+[]][1&1]]+/=/)[1e1+(1<<1|1)+(([]+/-/[(!!1+[])[1>>1]+(!!1+[])[1<<1^1]+(!1+[])[1|1<<1]+(!!1+[])[1^1]])[1^1]==+!1)]+(!![]+{})[1|1<<1]+[1+{}+1][!1+!1][(11>>1)+1]][1>>1][1]'], | |
'y': ['(/1/+1/[1<1][1%1])[1^11]'], | |
' ': ['({}+[])[1<<1^11>>1]','[[]+{}][!1.1%1][11111.1%11.1*111e11|!1]'], | |
}, obfuscate = function(input, map) { | |
var out = [], char; | |
for(char = 0; char < input.length; char++) { | |
if(map.hasOwnProperty(input[char])) { | |
out.push(map[input[char]][Math.floor(Math.random()*map[input[char]].length)]) | |
} else { | |
out.push('?'); | |
} | |
} | |
return out.join('+'); | |
}; | |
$(function() { | |
$('#obfuscate').on('click', function() { | |
$('#obfuscated').val(obfuscate($('#input').val(), obfuscateMap)); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment