<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CrackMe Challenge</title>
    <style>
        body { font-family: Arial, sans-serif; text-align: center; margin-top: 50px; }
        input { margin-top: 20px; padding: 10px; font-size: 16px; }
        button { padding: 10px 20px; font-size: 18px; background-color: #4CAF50; color: white; border: none; cursor: pointer; }
    </style>
</head>
<body>
    <h1>CrackMe Challenge</h1>
    <p>Set the hidden variable to <span id="target-value">????</span> and click the button to submit.</p>
    <input type="text" id="user-input" placeholder="Enter your guess...">
    <button onclick="submitInput()">Submit</button>

    <p id="feedback"></p>
    <script>// crackme.js
(function() {
    var _0x1a2b3c = 'c'; // Obfuscate variable names
    var _0x3d4e5f = 'b'; // Obfuscate variable names
    var _0x6f7g8h = 'a'; // Obfuscate variable names
    
    var _0x1000 = '1000'; // The hidden target value (obfuscated in real use)
    
    // A simple encryption function for the target value
    function encrypt(input, key) {
        var result = '';
        for (var i = 0; i < input.length; i++) {
            result += String.fromCharCode(input.charCodeAt(i) ^ key.charCodeAt(i % key.length));
        }
        return result;
    }

    // Anti-debugging (simulates fake checks)
    function antiDebug() {
        if (new Date().getSeconds() < 10) {
            alert('Suspicious activity detected! Try again later.');
            return false;
        }
        return true;
    }

    // Decrypt the value in hidden form (obfuscated and split)
    function decrypt(value) {
        var key = "j4568478sdfns8fsf8ds6f7sdf68sdf6ssf";
        var decrypted = '';
        for (var i = 0; i < value.length; i++) {
            decrypted += String.fromCharCode(value.charCodeAt(i) ^ key.charCodeAt(i % key.length));
        }
        return decrypted;
    }

    // Set the value to be decrypted
    var encryptedTargetValue = encrypt(_0x1000, 'j4568478sdfns8fsf8ds6f7sdf68sdf6ssf');
    var decryptedTargetValue = decrypt(encryptedTargetValue);

    // Final check when the user submits input
    function submitInput() {
        var userInput = document.getElementById("user-input").value;
        if (antiDebug()) {
            if (userInput === decryptedTargetValue) {
                document.getElementById("feedback").innerText = "Congratulations! You solved the challenge.";
            } else {
                document.getElementById("feedback").innerText = "Incorrect! Try again.";
            }
        }
    }

})();
</script>
</body>
</html>
