Custom Reversible Encryption System
Text Encoder/Decoder
Text to Encode:
Encode
Encoded Text:
Text to Decode:
Decode
Decoded Text:
Lua Script: Encode & Decode Functions
-- Encode function local function encodeText(inputText) local function scrambleWord(word) local scrambled = {} for i = 1, #word do table.insert(scrambled, word:sub(i, i)) end for i = 1, #scrambled - 1, 2 do scrambled[i], scrambled[i + 1] = scrambled[i + 1], scrambled[i] end return table.concat(scrambled) end local words = {} for word in inputText:gmatch("%S+") do table.insert(words, "v_" .. scrambleWord(word)) end return table.concat(words, " ") end -- Decode function local function decodeText(encodedText) local function unscrambleWord(word) local unscrambled = {} for i = 1, #word do table.insert(unscrambled, word:sub(i, i)) end for i = 1, #unscrambled - 1, 2 do unscrambled[i], unscrambled[i + 1] = unscrambled[i + 1], unscrambled[i] end return table.concat(unscrambled) end local decodedWords = {} for encodedWord in encodedText:gmatch("%S+") do if encodedWord:sub(1, 2) == "v_" then local scrambledWord = encodedWord:sub(3) table.insert(decodedWords, unscrambleWord(scrambledWord)) else table.insert(decodedWords, encodedWord) end end return table.concat(decodedWords, " ") end
Copy Lua Script