Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function notify(title, text)
- game:GetService("StarterGui"):SetCore("SendNotification",{
- Title = title,
- Text = text
- })
- end
- local G2L = {}
- if getgenv().chat_encryptor_connections or getgenv().chat_encryptor_connections ~= nil then
- for i,v in pairs(getgenv().chat_encryptor_connections) do
- v:Disconnect()
- end
- table.clear(getgenv().chat_encryptor_connections)
- notify("done", "script reset")
- end
- getgenv().chat_encryptor_connections = {}
- -- StarterGui.ScreenGui
- local playergui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
- if playergui:FindFirstChild("chatEncryptionGUI") ~= nil then
- playergui:FindFirstChild("chatEncryptionGUI"):Destroy()
- end
- G2L["1"] = Instance.new("ScreenGui", playergui)
- G2L["1"].ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- G2L["1"].Name = "chatEncryptionGUI"
- -- StarterGui.ScreenGui.Frame
- if G2L["1"]:FindFirstChild("Frame") ~= nil then
- G2L["1"]:FindFirstChild("Frame"):Destroy()
- end
- G2L["2"] = Instance.new("Frame", G2L["1"])
- G2L["2"].BorderSizePixel = 0
- G2L["2"].BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- G2L["2"].Size = UDim2.new(0, 164, 0, 144)
- G2L["2"].Position = UDim2.new(0, 0, 0.74032, 0)
- G2L["2"].BorderColor3 = Color3.fromRGB(0, 0, 0)
- G2L["2"].Name = "Frame"
- -- StarterGui.ScreenGui.Frame.encryptButton
- if G2L["2"]:FindFirstChild("encryptButton") ~= nil then
- G2L["2"]:FindFirstChild("encryptButton"):Destroy()
- end
- G2L["3"] = Instance.new("TextButton", G2L["2"])
- G2L["3"].TextWrapped = true
- G2L["3"].BorderSizePixel = 0
- G2L["3"].TextColor3 = Color3.fromRGB(0, 0, 0)
- G2L["3"].TextSize = 14
- G2L["3"].TextScaled = true
- G2L["3"].BackgroundColor3 = Color3.fromRGB(171, 255, 0)
- G2L["3"].FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Bold, Enum.FontStyle.Normal)
- G2L["3"].Size = UDim2.new(0, 164, 0, 50)
- G2L["3"].Name = "encryptButton"
- G2L["3"].BorderColor3 = Color3.fromRGB(0, 0, 0)
- G2L["3"].Text = "encrypt"
- G2L["3"].Position = UDim2.new(0, 0, 0.64931, 0)
- -- StarterGui.ScreenGui.Frame.TextBox
- if G2L["2"]:FindFirstChild("TextBox") ~= nil then
- G2L["2"]:FindFirstChild("TextBox"):Destroy()
- end
- G2L["5"] = Instance.new("TextBox", G2L["2"])
- G2L["5"].BorderSizePixel = 0
- G2L["5"].TextWrapped = true
- G2L["5"].TextSize = 14
- G2L["5"].TextColor3 = Color3.fromRGB(0, 0, 0)
- G2L["5"].TextScaled = true
- G2L["5"].BackgroundColor3 = Color3.fromRGB(0, 171, 255)
- G2L["5"].FontFace = Font.new("rbxasset://fonts/families/FredokaOne.json", Enum.FontWeight.Bold, Enum.FontStyle.Normal)
- G2L["5"].ClearTextOnFocus = false
- G2L["5"].PlaceholderText = "your text here.."
- G2L["5"].Size = UDim2.new(0, 164, 0, 50)
- G2L["5"].Position = UDim2.new(0, 0, 0.29861, 0)
- G2L["5"].BorderColor3 = Color3.fromRGB(0, 0, 0)
- G2L["5"].Text = ""
- G2L["5"].Name = "TextBox"
- -- StarterGui.ScreenGui.Frame.title
- if G2L["2"]:FindFirstChild("title") ~= nil then
- G2L["2"]:FindFirstChild("title"):Destroy()
- end
- G2L["6"] = Instance.new("TextLabel", G2L["2"])
- G2L["6"].TextWrapped = true
- G2L["6"].BorderSizePixel = 0
- G2L["6"].TextSize = 14
- G2L["6"].TextScaled = true
- G2L["6"].BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- G2L["6"].FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Bold, Enum.FontStyle.Normal)
- G2L["6"].TextColor3 = Color3.fromRGB(0, 0, 0)
- G2L["6"].Size = UDim2.new(0, 164, 0, 35)
- G2L["6"].BorderColor3 = Color3.fromRGB(0, 0, 0)
- G2L["6"].Text = "encrypt gui"
- G2L["6"].Name = "title"
- local function buildKeyArray(keyStr)
- local key = {}
- for i = #keyStr, 1, -1 do
- table.insert(key, string.sub(keyStr, i, i))
- end
- return key
- end
- local numToSymbol = {["0"]="!", ["1"]="@", ["2"]="#", ["3"]="$", ["4"]="%", ["5"]="^", ["6"]="&", ["7"]="*", ["8"]="(", ["9"]=")"}
- local symbolToNum = {}
- for n,s in pairs(numToSymbol) do symbolToNum[s] = n end
- local function encrypt(plaintext, key)
- local success, msg = pcall(function()
- local output = {}
- for i = 1, #plaintext do
- local c = string.sub(plaintext, i, i)
- local k = key[(i-1) % #key + 1]
- local character = string.char(string.byte(c) + string.byte(k))
- table.insert(output, character)
- end
- local base64 = crypt.base64encode(table.concat(output))
- local modified = base64:gsub("%d", function(d) return numToSymbol[d] end)
- return modified
- end)
- if not success then return end
- if success then return msg end
- end
- local function decrypt(ciphertext, key)
- local success, msg = pcall(function()
- local restored = ciphertext:gsub(".", function(c)
- return symbolToNum[c] or c
- end)
- local decoded = crypt.base64decode(restored)
- local output = {}
- for i = 1, #decoded do
- local c = string.sub(decoded, i, i)
- local k = key[(i-1) % #key + 1]
- local character = string.char(string.byte(c) - string.byte(k))
- table.insert(output, character)
- end
- return table.concat(output)
- end)
- if not success then return end
- if success then return msg end
- end
- local function gui_setup()
- local frm = G2L["2"]
- local text = ""
- getgenv().chat_encryptor_connections[1] = frm.TextBox:GetPropertyChangedSignal("Text"):Connect(function()
- text = frm.TextBox.Text
- end)
- getgenv().chat_encryptor_connections[2] = frm.encryptButton.Activated:Connect(function()
- if #text > 0 then
- local cipher = encrypt(text, buildKeyArray(getgenv().encryptionKey))
- if cipher == nil then
- notify("uhhhh.", "could not encrypt")
- return
- end
- setclipboard(cipher)
- frm.encryptButton.Text = "copied to clipboard"
- task.wait(0.75)
- frm.encryptButton.Text = "encrypt"
- end
- end)
- end
- task.spawn(gui_setup)
- getgenv().chat_encryptor_connections[3] = game:GetService("TextChatService").MessageReceived:Connect(function(msg)
- local decrypted = decrypt(msg.Text, buildKeyArray(getgenv().encryptionKey))
- if decrypted == nil then return end
- print("[DECRYPTOR] "..msg.TextSource.Name..": "..decrypted)
- end)
- -- dragging (thanks chatgpt)
- -- i made everything else tho
- -- Make the GUI draggable
- local UIS = game:GetService("UserInputService")
- local frame = G2L["2"] -- Your GUI Frame
- local dragging = false
- local dragInput, dragStart, startPos
- local function update(input)
- local delta = input.Position - dragStart
- frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X,
- startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- frame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = frame.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- dragging = false
- end
- end)
- end
- end)
- frame.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- dragInput = input
- end
- end)
- UIS.InputChanged:Connect(function(input)
- if input == dragInput and dragging then
- update(input)
- end
- end)
- return G2L["1"]
Add Comment
Please, Sign In to add comment