Русский шифратор 2905 года обновлённый 2.0

Шифратор на русском языке

// ==UserScript==// ==UserScript==
// @name         Русский шифратор 2905 года обновлённый 2.0
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Шифратор на русском языке
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Функция для смещения букв
    function shiftChar(char, shift) {
        const unicode = char.charCodeAt(0);
        if (unicode >= 1072 && unicode <= 1103) { // Проверка на буквы русского алфавита
            return String.fromCharCode(((unicode - 1072 + shift + 32) % 32) + 1072);
        }
        return char; // Возвращаем символ без изменений, если не русский
    }

    // Функция для шифрования
    function encrypt(text) {
        const words = text.split(' ').map(word => {
            let shifted = '';
            for (const char of word) {
                shifted += shiftChar(char, 5); // Смещение +5
            }
            shifted = shifted.split('').reverse().join('');
            return shifted;
        });
        return words.join(' ');
    }

    // Функция для дешифрования
    function decrypt(text) {
        const words = text.split(' ').map(word => {
            let shifted = '';
            for (const char of word) {
                shifted += shiftChar(char, -5); // Смещение -5
            }
            shifted = shifted.split('').reverse().join('');
            return shifted;
        });
        return words.join(' ');
    }

    // Создаем простой интерфейс
    const container = document.createElement('div');
    container.style.position = 'fixed';
    container.style.top = '290px';
    container.style.right = '10px';
    container.style.backgroundColor = 'white';
    container.style.border = '1px solid black';
    container.style.zIndex = '1000';
    container.style.padding = '20px';

    const textArea = document.createElement('textarea');
    textArea.placeholder = "Введите текст для шифрования...";
    textArea.style.width = '240px';
    textArea.style.height = '200px';
    container.appendChild(textArea);

    const encryptButton = document.createElement('button');
    encryptButton.innerText = 'Зашифровать';
    encryptButton.onclick = function() {
        const result = encrypt(textArea.value);
        resultArea.value = result; // Отображаем результат в результат-области
        navigator.clipboard.writeText(result).then(() => {
            alert('Зашифрованный текст скопирован в буфер обмена!');
        });
    };
    container.appendChild(encryptButton);

    const decryptButton = document.createElement('button');
    decryptButton.innerText = 'Расшифровать';
    decryptButton.onclick = function() {
        const result = decrypt(textArea.value);
        resultArea.value = result; // Отображаем результат в результат-области
        navigator.clipboard.writeText(result).then(() => {
            alert('Расшифрованный текст скопирован в буфер обмена!');
        });
    };
    container.appendChild(decryptButton);

    const resultArea = document.createElement('textarea');
    resultArea.placeholder = "Результат шифрования...";
    resultArea.style.width = '240px';
    resultArea.style.height = '200px';
    resultArea.readOnly = true;
    container.appendChild(resultArea);

    document.body.appendChild(container);
})();
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      2025-01-05
// @description  try to take over the world!
// @author       You
// @match        http://*/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址