-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.html
executable file
·63 lines (60 loc) · 1.71 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!doctype html>
<html>
<head>
<title>Non-Alphanumeric JavaScript Obfuscator</title>
<style>
body {
background: #ccc;
}
div, label, button {
font-family: monospace;
margin: 1em auto;
background: #efefef;
display: block;
width: 40%;
padding: .5em;
}
textarea {
width: calc(100% - 1em);
min-height: 200px;
clear: both;
border: 1px solid #000;
word-break: break-all;
}
button {
cursor: pointer;
border: none;
height: 2em;
width: 140px;
}
#warning:empty {
display: none;
}
</style>
</head>
<body>
<div id="instructions">Allowed characters:<br>0 1 2 3 4 5 6 7 8 9 ( ) { } [ ] < > = " / - . E O R S a b c d e f g h i j k l m n o p q r s t u v w x y z [space]</div>
<div id="warning"></div>
<textarea id="input">console.log("obfuscation is awesome")</textarea>
<button id="button" type="button">Obfuscate</button>
<textarea id="output"></textarea>
<script src="encode.js" async></script>
<script>
window.addEventListener('load', () => {
const button = document.getElementById('button'),
input = document.getElementById('input'),
output = document.getElementById('output'),
warning = document.getElementById('warning');
var allowedChars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", " ", "(", ")", "{", "}", "[", "]", "<", ">", "=", "\"", "/", "-", ".", "E", "O", "R", "S", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
input.addEventListener('keyup', e => {
if (e.key.length === 1 && allowedChars.indexOf(e.key) === -1) {
warning.innerHTML = 'invalid key: ' + e.key;
}
});
button.addEventListener('click', () => {
output.value = obfuscateLT(input.value);
});
});
</script>
</body>
</html>