Create your own Page to Encode URLs with Simple Base64 and ASCII Codes

Simple Code Base64 and ASCII

Usually this method is used to avoid immunify360 being too protective, which usually occurs when installing advertising code on a website. So because it is too protective, the code is considered malware or a trojan. So it is difficult for us to place the code into HTML, because of this rejection. And to avoid that, we use the method below to hide the actual script

copy the code below and create an index.html file

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript Code Encoder</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }
        label {
            display: block;
            margin-bottom: 5px;
        }
        textarea {
            width: 100%;
            height: 100px;
            padding: 8px;
            margin-bottom: 10px;
        }
        button {
            padding: 10px;
            background-color: #4CAF50;
            color: white;
            border: none;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <h1>JavaScript Code Encoder</h1>
    <label for="codeInput">Enter JavaScript Code:</label>
    <textarea id="codeInput" placeholder="Enter JavaScript code to encode"></textarea>
    <button onclick="encodeBase64()">Encode Base64</button>
    <button onclick="encodeASCII()">Encode ASCII</button>
    <button onclick="copyResult()">Copy Result</button>
    <h2>Encoded Result:</h2>
    <p id="result"></p>

    <script>
        function encodeBase64() {
            var codeInput = document.getElementById("codeInput").value;
            var encodedScript = btoa(codeInput);
            var encodedScriptTag = `<script>document.write(atob("${encodedScript}"))<\/script>`;
            document.getElementById("result").textContent = encodedScriptTag;
        }

        function encodeASCII() {
            var codeInput = document.getElementById("codeInput").value;
            var encodedScript = encodeToASCII(codeInput);
            var encodedScriptArray = Array.from(encodedScript);
            var encodedScriptTag = `<script>var y="";var x=[${encodedScriptArray.join(",")}];x.forEach(char=>{y+=String.fromCharCode(char)});document.write(y);<\/script>`;
            document.getElementById("result").textContent = encodedScriptTag;
        }

        function encodeToASCII(str) {
            var charCodes = [];
            for (var i = 0; i < str.length; i++) {
                charCodes.push(str.charCodeAt(i));
            }
            return charCodes;
        }

        function copyResult() {
            var resultElement = document.getElementById("result");
            var range = document.createRange();
            range.selectNode(resultElement);
            window.getSelection().removeAllRanges();
            window.getSelection().addRange(range);
            document.execCommand("copy");
            window.getSelection().removeAllRanges();
        }
    </script>
</body>
</html>

The site demo is here

close