{"id":1093,"date":"2026-02-12T11:30:22","date_gmt":"2026-02-12T10:30:22","guid":{"rendered":"https:\/\/www.datura.info\/?page_id=1093"},"modified":"2026-02-21T16:24:22","modified_gmt":"2026-02-21T15:24:22","slug":"email-encryption","status":"publish","type":"page","link":"https:\/\/www.datura.info\/?page_id=1093","title":{"rendered":"Email Encryption"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Email Encryption Tool<\/title>\n    <style>\n        * {\n            margin: 0;\n            padding: 0;\n            box-sizing: border-box;\n        }\n\n        body {\n            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            padding: 20px;\n            min-height: 100vh;\n        }\n\n        .container {\n            max-width: 900px;\n            margin: 0 auto;\n            background: white;\n            border-radius: 12px;\n            box-shadow: 0 10px 40px rgba(0,0,0,0.2);\n            overflow: hidden;\n        }\n\n        .header {\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            color: white;\n            padding: 24px;\n            text-align: center;\n        }\n\n        .header h1 {\n            font-size: 24px;\n            font-weight: 600;\n            margin-bottom: 8px;\n        }\n\n        .header p {\n            font-size: 14px;\n            opacity: 0.9;\n        }\n\n        .content {\n            padding: 24px;\n        }\n\n        .section {\n            margin-bottom: 24px;\n            padding: 16px;\n            background: #f9f9f9;\n            border-radius: 8px;\n        }\n\n        .section-title {\n            font-size: 16px;\n            font-weight: 600;\n            color: #333;\n            margin-bottom: 12px;\n            display: flex;\n            align-items: center;\n            gap: 8px;\n        }\n\n        .input-group {\n            margin-bottom: 16px;\n        }\n\n        label {\n            display: block;\n            font-size: 14px;\n            font-weight: 500;\n            color: #555;\n            margin-bottom: 6px;\n        }\n\n        textarea {\n            width: 100%;\n            min-height: 120px;\n            padding: 12px;\n            border: 2px solid #e0e0e0;\n            border-radius: 8px;\n            font-family: 'Courier New', monospace;\n            font-size: 13px;\n            resize: vertical;\n            transition: border-color 0.3s;\n        }\n\n        textarea:focus {\n            outline: none;\n            border-color: #667eea;\n        }\n\n        input[type=\"password\"],\n        input[type=\"text\"] {\n            width: 100%;\n            padding: 10px 12px;\n            border: 2px solid #e0e0e0;\n            border-radius: 8px;\n            font-size: 14px;\n            transition: border-color 0.3s;\n        }\n\n        input:focus {\n            outline: none;\n            border-color: #667eea;\n        }\n\n        select {\n            width: 100%;\n            padding: 10px 12px;\n            border: 2px solid #e0e0e0;\n            border-radius: 8px;\n            font-size: 14px;\n            background: white;\n            cursor: pointer;\n            transition: border-color 0.3s;\n        }\n\n        select:focus {\n            outline: none;\n            border-color: #667eea;\n        }\n\n        .checkbox-group {\n            display: flex;\n            align-items: center;\n            gap: 8px;\n            margin-top: 8px;\n        }\n\n        .checkbox-group input[type=\"checkbox\"] {\n            width: 18px;\n            height: 18px;\n            cursor: pointer;\n        }\n\n        .checkbox-group label {\n            margin: 0;\n            cursor: pointer;\n            font-weight: 400;\n        }\n\n        .button-group {\n            display: grid;\n            grid-template-columns: 1fr 1fr;\n            gap: 12px;\n            margin-top: 20px;\n        }\n\n        button {\n            padding: 12px 24px;\n            border: none;\n            border-radius: 8px;\n            font-size: 14px;\n            font-weight: 600;\n            cursor: pointer;\n            transition: all 0.3s;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            gap: 8px;\n        }\n\n        .btn-encrypt {\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            color: white;\n        }\n\n        .btn-encrypt:hover {\n            transform: translateY(-2px);\n            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);\n        }\n\n        .btn-decrypt {\n            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);\n            color: white;\n        }\n\n        .btn-decrypt:hover {\n            transform: translateY(-2px);\n            box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);\n        }\n\n        .btn-copy {\n            background: #4caf50;\n            color: white;\n            grid-column: 1 \/ -1;\n        }\n\n        .btn-copy:hover {\n            background: #45a049;\n            transform: translateY(-2px);\n        }\n\n        .btn-clear {\n            background: #ff9800;\n            color: white;\n            grid-column: 1 \/ -1;\n        }\n\n        .btn-clear:hover {\n            background: #e68900;\n        }\n\n        .btn-small {\n            padding: 6px 12px;\n            font-size: 12px;\n            background: #ff5252;\n            color: white;\n            border-radius: 4px;\n        }\n\n        .btn-small:hover {\n            background: #ff1744;\n        }\n\n        .btn-action {\n            padding: 8px 16px;\n            font-size: 13px;\n            background: #667eea;\n            color: white;\n            border-radius: 6px;\n            margin-right: 8px;\n        }\n\n        .btn-action:hover {\n            background: #5568d3;\n        }\n\n        .info-box {\n            background: #f0f7ff;\n            border-left: 4px solid #667eea;\n            padding: 12px 16px;\n            border-radius: 4px;\n            font-size: 13px;\n            color: #555;\n            margin-top: 16px;\n        }\n\n        .hash-display {\n            background: white;\n            border: 2px solid #667eea;\n            border-radius: 8px;\n            padding: 12px;\n            font-family: 'Courier New', monospace;\n            font-size: 12px;\n            word-break: break-all;\n            margin: 12px 0;\n        }\n\n        .status-indicator {\n            display: inline-block;\n            width: 12px;\n            height: 12px;\n            border-radius: 50%;\n            margin-right: 8px;\n        }\n\n        .status-ok {\n            background: #4caf50;\n        }\n\n        .status-error {\n            background: #ff5252;\n        }\n\n        .status-warning {\n            background: #ff9800;\n        }\n\n        .saved-passwords {\n            background: white;\n            border-radius: 8px;\n            padding: 16px;\n            margin-top: 12px;\n        }\n\n        .password-item, .name-item {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            padding: 8px;\n            background: #f9f9f9;\n            border-radius: 6px;\n            margin-bottom: 8px;\n        }\n\n        .password-item:last-child, .name-item:last-child {\n            margin-bottom: 0;\n        }\n\n        .alert {\n            padding: 12px;\n            border-radius: 8px;\n            margin-bottom: 16px;\n            font-size: 14px;\n        }\n\n        .alert-success {\n            background: #d4edda;\n            color: #155724;\n            border: 1px solid #c3e6cb;\n        }\n\n        .alert-error {\n            background: #f8d7da;\n            color: #721c24;\n            border: 1px solid #f5c6cb;\n        }\n\n        .hidden {\n            display: none;\n        }\n\n        .modal {\n            display: none;\n            position: fixed;\n            z-index: 1000;\n            left: 0;\n            top: 0;\n            width: 100%;\n            height: 100%;\n            background: rgba(0,0,0,0.5);\n            align-items: center;\n            justify-content: center;\n        }\n\n        .modal.active {\n            display: flex;\n        }\n\n        .modal-content {\n            background: white;\n            padding: 30px;\n            border-radius: 12px;\n            max-width: 600px;\n            width: 90%;\n            box-shadow: 0 10px 40px rgba(0,0,0,0.3);\n        }\n\n        .modal-header {\n            font-size: 20px;\n            font-weight: 600;\n            margin-bottom: 20px;\n            color: #333;\n        }\n\n        .modal-buttons {\n            display: flex;\n            gap: 12px;\n            margin-top: 20px;\n            justify-content: flex-end;\n        }\n\n        .add-name-form {\n            display: flex;\n            gap: 8px;\n            margin-top: 12px;\n        }\n\n        .add-name-form input {\n            flex: 1;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"container\">\n        <div class=\"header\">\n            <h1>\ud83d\udd10 Email Encryption Tool<\/h1>\n            <p>Secure your email content with advanced encryption and integrity verification<\/p>\n        <\/div>\n\n        <div class=\"content\">\n            <div id=\"alertBox\" class=\"hidden\"><\/div>\n\n            <!-- Page Integrity Section -->\n            <div class=\"section\">\n                <div class=\"section-title\">\n                    <span>\ud83d\udee1\ufe0f<\/span>\n                    Page Integrity Verification\n                    <span id=\"integrityStatus\" class=\"status-indicator status-warning\"><\/span>\n                <\/div>\n                \n                <div class=\"input-group\">\n                    <label>Page Hash (SHA-256)<\/label>\n                    <div class=\"hash-display\" id=\"pageHashDisplay\">Calculating&#8230;<\/div>\n                    <button class=\"btn-action\" onclick=\"copyPageHash()\">\ud83d\udccb Copy Page Hash<\/button>\n                    <button class=\"btn-action\" onclick=\"showVerifyModal()\">\ud83d\udd0d Verify Integrity<\/button>\n                <\/div>\n\n                <div class=\"input-group\">\n                    <label for=\"storedHash\">Stored Hash (for verification)<\/label>\n                    <input type=\"text\" id=\"storedHash\" placeholder=\"Paste the original page hash here\">\n                    <small style=\"color: #666; font-size: 12px;\">Save the hash from first launch and paste it here to verify page integrity<\/small>\n                <\/div>\n            <\/div>\n\n            <!-- User Identity Section -->\n            <div class=\"section\">\n                <div class=\"section-title\">\n                    <span>\ud83d\udc64<\/span>\n                    User Identity &#038; Signature\n                <\/div>\n                \n                <div class=\"input-group\">\n                    <label for=\"userName\">Your Name (will be hashed with message)<\/label>\n                    <select id=\"userName\">\n                        <option value=\"\">&#8212; Select or add your name &#8212;<\/option>\n                    <\/select>\n                <\/div>\n\n                <div class=\"add-name-form\">\n                    <input type=\"text\" id=\"newNameInput\" placeholder=\"Enter new name\">\n                    <button class=\"btn-action\" onclick=\"addName()\">\u2795 Add Name<\/button>\n                <\/div>\n\n                <div class=\"saved-passwords\" id=\"namesListSection\">\n                    <strong style=\"font-size: 14px; color: #333;\">Registered Names:<\/strong>\n                    <div id=\"namesList\" style=\"margin-top: 8px;\"><\/div>\n                <\/div>\n            <\/div>\n\n            <!-- Encryption Settings -->\n            <div class=\"section\">\n                <div class=\"section-title\">\n                    <span>\u2699\ufe0f<\/span>\n                    Encryption Settings\n                <\/div>\n                \n                <div class=\"input-group\">\n                    <label for=\"method\">Encryption Method<\/label>\n                    <select id=\"method\">\n                        <option value=\"aes-256\">AES-256 (Fast, 1 layer)<\/option>\n                        <option value=\"aes-512\">AES-512 (Strong, 2 layers)<\/option>\n                        <option value=\"aes-1024\">AES-1024 (Very Strong, 4 layers)<\/option>\n                        <option value=\"aes-2048\">AES-2048 (Maximum, 8 layers)<\/option>\n                        <option value=\"aes-4096\">AES-4096 (Extreme, 16 layers)<\/option>\n                        <option value=\"sha-256\">SHA-256 Hash (One-way)<\/option>\n                        <option value=\"sha-512\">SHA-512 Hash (One-way)<\/option>\n                    <\/select>\n                    <small id=\"methodInfo\" style=\"display: block; margin-top: 6px; color: #666; font-size: 12px;\"><\/small>\n                <\/div>\n\n                <div class=\"input-group\">\n                    <label for=\"password\">Password<\/label>\n                    <input type=\"password\" id=\"password\" placeholder=\"Enter encryption password\">\n                    <div class=\"checkbox-group\">\n                        <input type=\"checkbox\" id=\"savePassword\">\n                        <label for=\"savePassword\">Save this password for future use<\/label>\n                    <\/div>\n                <\/div>\n\n                <div class=\"saved-passwords\" id=\"savedPasswordsSection\">\n                    <strong style=\"font-size: 14px; color: #333;\">Saved Passwords:<\/strong>\n                    <div id=\"savedPasswordsList\" style=\"margin-top: 8px;\"><\/div>\n                <\/div>\n            <\/div>\n\n            <!-- Email Content -->\n            <div class=\"section\">\n                <div class=\"section-title\">\n                    <span>\ud83d\udcdd<\/span>\n                    Email Content\n                <\/div>\n                <div class=\"input-group\">\n                    <label for=\"inputText\">Input Text<\/label>\n                    <textarea id=\"inputText\" placeholder=\"Enter email content to encrypt or paste encrypted content to decrypt...\"><\/textarea>\n                <\/div>\n            <\/div>\n\n            <div class=\"button-group\">\n                <button class=\"btn-encrypt\" onclick=\"encryptText()\">\n                    \ud83d\udd12 Encrypt\n                <\/button>\n                <button class=\"btn-decrypt\" onclick=\"decryptText()\">\n                    \ud83d\udd13 Decrypt\n                <\/button>\n                <button class=\"btn-copy\" onclick=\"copyOutput()\">\n                    \ud83d\udccb Copy Output\n                <\/button>\n                <button class=\"btn-clear\" onclick=\"clearAll()\">\n                    \ud83d\uddd1\ufe0f Clear All\n                <\/button>\n            <\/div>\n\n            <div class=\"section\">\n                <div class=\"section-title\">\n                    <span>\ud83d\udce4<\/span>\n                    Output\n                <\/div>\n                <div class=\"input-group\">\n                    <textarea id=\"outputText\" placeholder=\"Encrypted or decrypted content will appear here...\" readonly><\/textarea>\n                <\/div>\n            <\/div>\n\n            <div class=\"info-box\">\n                <strong>\ud83d\udca1 How to use:<\/strong><br>\n                1. On first launch, copy and save the Page Hash<br>\n                2. Paste the saved hash in &#8220;Stored Hash&#8221; field for integrity verification<br>\n                3. Add your name to sign encrypted messages<br>\n                4. Select encryption method and enter password<br>\n                5. Encrypt or decrypt your messages<br><br>\n                <strong>\ud83d\udd10 Encryption Methods:<\/strong><br>\n                \u2022 AES-256: Single layer (fastest, standard security)<br>\n                \u2022 AES-512: 2 layers cascade (stronger)<br>\n                \u2022 AES-1024: 4 layers cascade (very strong)<br>\n                \u2022 AES-2048: 8 layers cascade (maximum security)<br>\n                \u2022 AES-4096: 16 layers cascade (extreme security, slower)<br><br>\n                <strong>\u2328\ufe0f Keyboard shortcuts:<\/strong> Ctrl+E (Encrypt) \u2022 Ctrl+D (Decrypt) \u2022 Ctrl+K (Copy)<br><br>\n                <strong>\ud83d\udd12 Security:<\/strong> Cascade encryption applies multiple independent AES-256 layers with unique keys for maximum protection\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <!-- Verification Modal -->\n    <div id=\"verifyModal\" class=\"modal\">\n        <div class=\"modal-content\">\n            <div class=\"modal-header\">\ud83d\udd0d Page Integrity Verification<\/div>\n            <div id=\"verifyResult\"><\/div>\n            <div class=\"modal-buttons\">\n                <button class=\"btn-action\" onclick=\"closeVerifyModal()\">Close<\/button>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <script>\n        \/\/ Global variables\n        let savedPasswords = {};\n        let registeredNames = {};\n        let pageHash = '';\n        \n        \/\/ Calculate page hash on load\n        async function calculatePageHash() {\n            const htmlContent = document.documentElement.outerHTML;\n            const encoder = new TextEncoder();\n            const data = encoder.encode(htmlContent);\n            const hashBuffer = await crypto.subtle.digest('SHA-256', data);\n            const hashArray = Array.from(new Uint8Array(hashBuffer));\n            pageHash = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');\n            document.getElementById('pageHashDisplay').textContent = pageHash;\n            \n            \/\/ Check if stored hash exists\n            const storedHash = localStorage.getItem('pageIntegrityHash');\n            if (storedHash) {\n                document.getElementById('storedHash').value = storedHash;\n                checkIntegrity();\n            } else {\n                showAlert('First launch: Please save the Page Hash for future integrity verification', 'success');\n            }\n        }\n\n        \/\/ Copy page hash\n        async function copyPageHash() {\n            try {\n                await navigator.clipboard.writeText(pageHash);\n                showAlert('Page hash copied to clipboard', 'success');\n            } catch (err) {\n                showAlert('Failed to copy hash', 'error');\n            }\n        }\n\n        \/\/ Check page integrity\n        function checkIntegrity() {\n            const storedHash = document.getElementById('storedHash').value.trim();\n            const statusIndicator = document.getElementById('integrityStatus');\n            \n            if (!storedHash) {\n                statusIndicator.className = 'status-indicator status-warning';\n                return false;\n            }\n            \n            if (storedHash === pageHash) {\n                statusIndicator.className = 'status-indicator status-ok';\n                localStorage.setItem('pageIntegrityHash', storedHash);\n                return true;\n            } else {\n                statusIndicator.className = 'status-indicator status-error';\n                return false;\n            }\n        }\n\n        \/\/ Show verification modal\n        function showVerifyModal() {\n            const storedHash = document.getElementById('storedHash').value.trim();\n            const modal = document.getElementById('verifyModal');\n            const result = document.getElementById('verifyResult');\n            \n            if (!storedHash) {\n                result.innerHTML = `\n                    <div style=\"padding: 20px; text-align: center;\">\n                        <div style=\"font-size: 48px; margin-bottom: 16px;\">\u26a0\ufe0f<\/div>\n                        <div style=\"font-size: 16px; color: #333; margin-bottom: 12px;\">No stored hash for verification<\/div>\n                        <div style=\"font-size: 14px; color: #666;\">Please paste the original page hash in the \"Stored Hash\" field<\/div>\n                    <\/div>\n                `;\n            } else if (storedHash === pageHash) {\n                result.innerHTML = `\n                    <div style=\"padding: 20px; text-align: center;\">\n                        <div style=\"font-size: 48px; margin-bottom: 16px;\">\u2705<\/div>\n                        <div style=\"font-size: 18px; color: #4caf50; font-weight: 600; margin-bottom: 12px;\">Page Integrity Verified<\/div>\n                        <div style=\"font-size: 14px; color: #666;\">The page has not been modified<\/div>\n                        <div style=\"margin-top: 20px; padding: 12px; background: #f9f9f9; border-radius: 6px; word-break: break-all; font-family: monospace; font-size: 11px;\">\n                            ${pageHash}\n                        <\/div>\n                    <\/div>\n                `;\n            } else {\n                result.innerHTML = `\n                    <div style=\"padding: 20px; text-align: center;\">\n                        <div style=\"font-size: 48px; margin-bottom: 16px;\">\u274c<\/div>\n                        <div style=\"font-size: 18px; color: #ff5252; font-weight: 600; margin-bottom: 12px;\">Integrity Check Failed<\/div>\n                        <div style=\"font-size: 14px; color: #666; margin-bottom: 20px;\">Warning: The page may have been modified<\/div>\n                        <div style=\"text-align: left;\">\n                            <div style=\"margin-bottom: 12px;\">\n                                <strong>Expected:<\/strong>\n                                <div style=\"margin-top: 8px; padding: 12px; background: #f9f9f9; border-radius: 6px; word-break: break-all; font-family: monospace; font-size: 11px;\">\n                                    ${storedHash}\n                                <\/div>\n                            <\/div>\n                            <div>\n                                <strong>Current:<\/strong>\n                                <div style=\"margin-top: 8px; padding: 12px; background: #ffebee; border-radius: 6px; word-break: break-all; font-family: monospace; font-size: 11px;\">\n                                    ${pageHash}\n                                <\/div>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n                `;\n            }\n            \n            modal.classList.add('active');\n        }\n\n        function closeVerifyModal() {\n            document.getElementById('verifyModal').classList.remove('active');\n        }\n\n        \/\/ Names management\n        function loadNames() {\n            const storedNames = localStorage.getItem('registeredNames');\n            if (storedNames) {\n                try {\n                    registeredNames = JSON.parse(storedNames);\n                } catch (e) {\n                    registeredNames = {};\n                }\n            }\n            updateNamesUI();\n        }\n\n        function saveNames() {\n            localStorage.setItem('registeredNames', JSON.stringify(registeredNames));\n        }\n\n        async function addName() {\n            const nameInput = document.getElementById('newNameInput');\n            const name = nameInput.value.trim();\n            \n            if (!name) {\n                showAlert('Please enter a name', 'error');\n                return;\n            }\n            \n            if (registeredNames[name]) {\n                showAlert('This name is already registered', 'error');\n                return;\n            }\n            \n            \/\/ Calculate hash for the name\n            const nameHash = await hashText(name, 'sha-256');\n            registeredNames[name] = nameHash;\n            saveNames();\n            updateNamesUI();\n            nameInput.value = '';\n            showAlert('Name added successfully', 'success');\n        }\n\n        function deleteName(name) {\n            delete registeredNames[name];\n            saveNames();\n            updateNamesUI();\n            showAlert('Name deleted: ' + name, 'success');\n        }\n\n        function updateNamesUI() {\n            \/\/ Update select dropdown\n            const select = document.getElementById('userName');\n            select.innerHTML = '<option value=\"\">-- Select or add your name --<\/option>';\n            \n            for (const name in registeredNames) {\n                const option = document.createElement('option');\n                option.value = name;\n                option.textContent = name;\n                select.appendChild(option);\n            }\n            \n            \/\/ Update names list\n            const list = document.getElementById('namesList');\n            if (Object.keys(registeredNames).length === 0) {\n                list.innerHTML = '<p style=\"color: #999; font-size: 13px;\">No registered names<\/p>';\n                return;\n            }\n\n            list.innerHTML = '';\n            for (const [name, hash] of Object.entries(registeredNames)) {\n                const item = document.createElement('div');\n                item.className = 'name-item';\n                item.innerHTML = `\n                    <div>\n                        <div style=\"font-size: 13px; font-weight: 600;\">${name}<\/div>\n                        <div style=\"font-size: 11px; color: #666; font-family: monospace; margin-top: 4px;\">${hash.substring(0, 32)}...<\/div>\n                    <\/div>\n                    <button class=\"btn-small\" onclick=\"deleteName('${name}')\">Delete<\/button>\n                `;\n                list.appendChild(item);\n            }\n        }\n\n        \/\/ Load saved passwords\n        function loadSavedPasswords() {\n            const storedData = localStorage.getItem('encryptionPasswords');\n            if (storedData) {\n                try {\n                    savedPasswords = JSON.parse(storedData);\n                } catch (e) {\n                    savedPasswords = {};\n                }\n            }\n            displaySavedPasswords();\n        }\n\n        function savePasswordsToStorage() {\n            localStorage.setItem('encryptionPasswords', JSON.stringify(savedPasswords));\n        }\n\n        function displaySavedPasswords() {\n            const list = document.getElementById('savedPasswordsList');\n            if (Object.keys(savedPasswords).length === 0) {\n                list.innerHTML = '<p style=\"color: #999; font-size: 13px;\">No saved passwords<\/p>';\n                return;\n            }\n\n            list.innerHTML = '';\n            for (const [name, password] of Object.entries(savedPasswords)) {\n                const item = document.createElement('div');\n                item.className = 'password-item';\n                item.innerHTML = `\n                    <span style=\"font-size: 13px;\">${name}<\/span>\n                    <div>\n                        <button class=\"btn-small\" onclick=\"usePassword('${name}')\" style=\"background: #4caf50; margin-right: 8px;\">Use<\/button>\n                        <button class=\"btn-small\" onclick=\"deletePassword('${name}')\">Delete<\/button>\n                    <\/div>\n                `;\n                list.appendChild(item);\n            }\n        }\n\n        function usePassword(name) {\n            document.getElementById('password').value = savedPasswords[name];\n            showAlert('Password loaded: ' + name, 'success');\n        }\n\n        function deletePassword(name) {\n            delete savedPasswords[name];\n            savePasswordsToStorage();\n            displaySavedPasswords();\n            showAlert('Password deleted: ' + name, 'success');\n        }\n\n        \/\/ Show alert\n        function showAlert(message, type) {\n            const alertBox = document.getElementById('alertBox');\n            alertBox.className = type === 'success' ? 'alert alert-success' : 'alert alert-error';\n            alertBox.textContent = message;\n            alertBox.classList.remove('hidden');\n            setTimeout(() => alertBox.classList.add('hidden'), 4000);\n        }\n\n        \/\/ Update method info\n        document.getElementById('method').addEventListener('change', function() {\n            const info = document.getElementById('methodInfo');\n            const method = this.value;\n            const infoTexts = {\n                'aes-256': 'Single layer AES-256-GCM encryption (fastest)',\n                'aes-512': 'Double layer cascade encryption (2x AES-256)',\n                'aes-1024': 'Quad layer cascade encryption (4x AES-256) - Very secure',\n                'aes-2048': 'Octo layer cascade encryption (8x AES-256) - Maximum security',\n                'aes-4096': 'Extreme 16-layer cascade encryption (16x AES-256) - Slower but extremely secure',\n                'sha-256': 'One-way hash - cannot be decrypted',\n                'sha-512': 'One-way hash with 512-bit output - cannot be decrypted'\n            };\n            info.textContent = infoTexts[method] || '';\n        });\n\n        \/\/ Encrypt text\n        async function encryptText() {\n            \/\/ Verify page integrity first\n            if (!checkIntegrity()) {\n                showAlert('\u26a0\ufe0f Page integrity verification failed! Operation cancelled.', 'error');\n                showVerifyModal();\n                return;\n            }\n\n            const input = document.getElementById('inputText').value;\n            const password = document.getElementById('password').value;\n            const method = document.getElementById('method').value;\n            const savePass = document.getElementById('savePassword').checked;\n            const userName = document.getElementById('userName').value;\n\n            if (!input) {\n                showAlert('Please enter text to encrypt', 'error');\n                return;\n            }\n\n            if (!password) {\n                showAlert('Please enter a password', 'error');\n                return;\n            }\n\n            if (!userName) {\n                showAlert('Please select your name for signature', 'error');\n                return;\n            }\n\n            try {\n                \/\/ Add name hash to the message\n                const nameHash = registeredNames[userName];\n                const signedMessage = `[NAME:${userName}:${nameHash}]${input}`;\n                \n                let output;\n                \n                if (method === 'sha-256' || method === 'sha-512') {\n                    output = await hashText(signedMessage + password, method);\n                    showAlert('Text hashed successfully (one-way, cannot be decrypted)', 'success');\n                } else {\n                    \/\/ Show progress for multi-layer encryption\n                    const layers = getEncryptionLayers(method);\n                    if (layers > 1) {\n                        showAlert(`\u23f3 Encrypting with ${layers} layers...`, 'success');\n                    }\n                    \n                    output = await cascadeEncrypt(signedMessage, password, method);\n                    showAlert(`Text encrypted successfully with ${method.toUpperCase()}`, 'success');\n                }\n\n                document.getElementById('outputText').value = output;\n\n                \/\/ Save password if checked\n                if (savePass && !savedPasswords[password.substring(0, 10) + '...']) {\n                    const passwordName = password.substring(0, 10) + '...';\n                    savedPasswords[passwordName] = password;\n                    savePasswordsToStorage();\n                    displaySavedPasswords();\n                }\n            } catch (error) {\n                showAlert('Encryption failed: ' + error.message, 'error');\n            }\n        }\n\n        \/\/ Decrypt text\n        async function decryptText() {\n            \/\/ Verify page integrity first\n            if (!checkIntegrity()) {\n                showAlert('\u26a0\ufe0f Page integrity verification failed! Operation cancelled.', 'error');\n                showVerifyModal();\n                return;\n            }\n\n            const input = document.getElementById('inputText').value;\n            const password = document.getElementById('password').value;\n            const method = document.getElementById('method').value;\n\n            if (!input) {\n                showAlert('Please enter text to decrypt', 'error');\n                return;\n            }\n\n            if (!password) {\n                showAlert('Please enter a password', 'error');\n                return;\n            }\n\n            if (method === 'sha-256' || method === 'sha-512') {\n                showAlert('Hash methods cannot be decrypted (one-way only)', 'error');\n                return;\n            }\n\n            try {\n                \/\/ Show progress for multi-layer decryption\n                const layers = getEncryptionLayers(method);\n                if (layers > 1) {\n                    showAlert(`\u23f3 Decrypting ${layers} layers...`, 'success');\n                }\n                \n                const decrypted = await cascadeDecrypt(input, password, method);\n                \n                \/\/ Extract and verify name signature\n                const nameMatch = decrypted.match(\/^\\[NAME:([^:]+):([^\\]]+)\\]\/);\n                if (nameMatch) {\n                    const senderName = nameMatch[1];\n                    const senderHash = nameMatch[2];\n                    const message = decrypted.substring(nameMatch[0].length);\n                    \n                    \/\/ Verify signature\n                    if (registeredNames[senderName] === senderHash) {\n                        document.getElementById('outputText').value = message;\n                        showAlert(`\u2705 Decrypted successfully! Signed by: ${senderName} (verified)`, 'success');\n                    } else {\n                        document.getElementById('outputText').value = message;\n                        showAlert(`\u26a0\ufe0f Decrypted but signature verification failed! Claimed sender: ${senderName}`, 'error');\n                    }\n                } else {\n                    document.getElementById('outputText').value = decrypted;\n                    showAlert('\u26a0\ufe0f Decrypted but no signature found (old format?)', 'error');\n                }\n            } catch (error) {\n                showAlert('Decryption failed: Wrong password or corrupted data', 'error');\n            }\n        }\n\n        \/\/ Get number of encryption layers\n        function getEncryptionLayers(method) {\n            const layerMap = {\n                'aes-256': 1,\n                'aes-512': 2,\n                'aes-1024': 4,\n                'aes-2048': 8,\n                'aes-4096': 16\n            };\n            return layerMap[method] || 1;\n        }\n\n        \/\/ Cascade encryption with multiple layers\n        async function cascadeEncrypt(text, password, method) {\n            const layers = getEncryptionLayers(method);\n            let encrypted = text;\n            \n            for (let i = 0; i < layers; i++) {\n                \/\/ Derive a unique key for each layer using different salt\n                const layerPassword = password + ':layer:' + i;\n                encrypted = await aesEncrypt(encrypted, layerPassword);\n            }\n            \n            \/\/ Prepend method identifier\n            return `[${method}]${encrypted}`;\n        }\n\n        \/\/ Cascade decryption with multiple layers\n        async function cascadeDecrypt(encryptedText, password, method) {\n            \/\/ Extract method from encrypted text\n            const methodMatch = encryptedText.match(\/^\\[([^\\]]+)\\]\/);\n            let extractedMethod = method;\n            let encrypted = encryptedText;\n            \n            if (methodMatch) {\n                extractedMethod = methodMatch[1];\n                encrypted = encryptedText.substring(methodMatch[0].length);\n            }\n            \n            const layers = getEncryptionLayers(extractedMethod);\n            let decrypted = encrypted;\n            \n            \/\/ Decrypt in reverse order\n            for (let i = layers - 1; i >= 0; i--) {\n                const layerPassword = password + ':layer:' + i;\n                decrypted = await aesDecrypt(decrypted, layerPassword);\n            }\n            \n            return decrypted;\n        }\n\n        \/\/ AES Encryption\n        async function aesEncrypt(text, password, method) {\n            const encoder = new TextEncoder();\n            const data = encoder.encode(text);\n            \n            const keyMaterial = await crypto.subtle.importKey(\n                'raw',\n                encoder.encode(password),\n                'PBKDF2',\n                false,\n                ['deriveBits', 'deriveKey']\n            );\n\n            const salt = crypto.getRandomValues(new Uint8Array(16));\n            \n            const key = await crypto.subtle.deriveKey(\n                {\n                    name: 'PBKDF2',\n                    salt: salt,\n                    iterations: 100000,\n                    hash: 'SHA-256'\n                },\n                keyMaterial,\n                { name: 'AES-GCM', length: 256 },\n                true,\n                ['encrypt', 'decrypt']\n            );\n\n            const iv = crypto.getRandomValues(new Uint8Array(12));\n            const encrypted = await crypto.subtle.encrypt(\n                { name: 'AES-GCM', iv: iv },\n                key,\n                data\n            );\n\n            const encryptedArray = new Uint8Array(encrypted);\n            const resultArray = new Uint8Array(salt.length + iv.length + encryptedArray.length);\n            resultArray.set(salt, 0);\n            resultArray.set(iv, salt.length);\n            resultArray.set(encryptedArray, salt.length + iv.length);\n\n            return btoa(String.fromCharCode(...resultArray));\n        }\n\n        \/\/ AES Decryption\n        async function aesDecrypt(encryptedText, password, method) {\n            const encoder = new TextEncoder();\n            const encryptedArray = Uint8Array.from(atob(encryptedText), c => c.charCodeAt(0));\n\n            const salt = encryptedArray.slice(0, 16);\n            const iv = encryptedArray.slice(16, 28);\n            const data = encryptedArray.slice(28);\n\n            const keyMaterial = await crypto.subtle.importKey(\n                'raw',\n                encoder.encode(password),\n                'PBKDF2',\n                false,\n                ['deriveBits', 'deriveKey']\n            );\n\n            const key = await crypto.subtle.deriveKey(\n                {\n                    name: 'PBKDF2',\n                    salt: salt,\n                    iterations: 100000,\n                    hash: 'SHA-256'\n                },\n                keyMaterial,\n                { name: 'AES-GCM', length: 256 },\n                true,\n                ['encrypt', 'decrypt']\n            );\n\n            const decrypted = await crypto.subtle.decrypt(\n                { name: 'AES-GCM', iv: iv },\n                key,\n                data\n            );\n\n            const decoder = new TextDecoder();\n            return decoder.decode(decrypted);\n        }\n\n        \/\/ Hash text\n        async function hashText(text, method) {\n            const encoder = new TextEncoder();\n            const data = encoder.encode(text);\n            const hashAlgo = method === 'sha-512' ? 'SHA-512' : 'SHA-256';\n            const hashBuffer = await crypto.subtle.digest(hashAlgo, data);\n            const hashArray = Array.from(new Uint8Array(hashBuffer));\n            return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');\n        }\n\n        \/\/ Copy output\n        async function copyOutput() {\n            const output = document.getElementById('outputText').value;\n            if (!output) {\n                showAlert('No output to copy', 'error');\n                return;\n            }\n            \n            try {\n                await navigator.clipboard.writeText(output);\n                showAlert('Output copied to clipboard', 'success');\n            } catch (err) {\n                const textarea = document.getElementById('outputText');\n                textarea.select();\n                document.execCommand('copy');\n                showAlert('Output copied to clipboard', 'success');\n            }\n        }\n\n        \/\/ Clear all\n        function clearAll() {\n            document.getElementById('inputText').value = '';\n            document.getElementById('outputText').value = '';\n            document.getElementById('password').value = '';\n            document.getElementById('savePassword').checked = false;\n            showAlert('All fields cleared', 'success');\n        }\n\n        \/\/ Keyboard shortcuts\n        document.addEventListener('keydown', (e) => {\n            if ((e.ctrlKey || e.metaKey) && e.key === 'e') {\n                e.preventDefault();\n                encryptText();\n            }\n            if ((e.ctrlKey || e.metaKey) && e.key === 'd') {\n                e.preventDefault();\n                decryptText();\n            }\n            if ((e.ctrlKey || e.metaKey) && e.key === 'k') {\n                e.preventDefault();\n                copyOutput();\n            }\n        });\n\n        \/\/ Update integrity status when hash changes\n        document.getElementById('storedHash').addEventListener('input', checkIntegrity);\n\n        \/\/ Initialize on load\n        window.addEventListener('DOMContentLoaded', async () => {\n            await calculatePageHash();\n            loadSavedPasswords();\n            loadNames();\n            \/\/ Trigger method info display\n            document.getElementById('method').dispatchEvent(new Event('change'));\n        });\n    <\/script>\n<\/body>\n<\/html>\n\n\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Email Encryption Tool \ud83d\udd10 Email Encryption Tool Secure your email content with advanced encryption and integrity verification \ud83d\udee1\ufe0f Page Integrity Verification Page Hash (SHA-256) Calculating&#8230; \ud83d\udccb Copy Page Hash \ud83d\udd0d Verify Integrity Stored Hash (for verification) Save the hash from first launch and paste it here to verify page integrity \ud83d\udc64 User Identity &#038; Signature [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1093","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.datura.info\/index.php?rest_route=\/wp\/v2\/pages\/1093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datura.info\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.datura.info\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.datura.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datura.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1093"}],"version-history":[{"count":6,"href":"https:\/\/www.datura.info\/index.php?rest_route=\/wp\/v2\/pages\/1093\/revisions"}],"predecessor-version":[{"id":1102,"href":"https:\/\/www.datura.info\/index.php?rest_route=\/wp\/v2\/pages\/1093\/revisions\/1102"}],"wp:attachment":[{"href":"https:\/\/www.datura.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}