SS • Lua
214 subscribers
209 photos
24 videos
714 files
133 links
- > offline .
Download Telegram
local enc = "" --需要被加密的值
-------------------------------------------------------------------------
function encode(number)
local base = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
local index = number % 62 + 1
local result = base:sub(index, index)
local quotient = math.floor(number / 62)
while quotient ~= 0 do
index = quotient % 62 + 1
quotient = math.floor(quotient / 62)
result = base:sub(index, index) .. result
end
return result
end
print(encode(enc))

local dec = "" --需要被解密的值
------------------------------------------------------------------------
function decode(number)
local base = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
local char = number:sub(1, 1)
local result = base:find(char) - 1
local limit = number:len()
for i=2, limit do
result = 62 * result + (base:find(number:sub(i, i)) - 1)
end
return result
end
print(decode(dec))
👍1
Base62 ( Encode ~ Decode )
local enc = "" --需要被加密的值
----------------------------------
local function str_split(str, size)
local result = {}
for i=1, #str, size do
table.insert(result, str:sub(i, i + size - 1))
end
return result
end

local function dec2bin(num)
local result = ""
repeat
local halved = num / 2
local int, frac = math.modf(halved)
num = int
result = math.ceil(frac) .. result
until num == 0
return result
end

local function padRight(str, length, char)
while #str % length ~= 0 do
str = str .. char
end
return str
end

local base32Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"

function base32_encode(str)
-- Create binary string zeropadded to eight bits
local binary = str:gsub(".", function (char)
return string.format("%08u", dec2bin(char:byte()))
end)

-- Split to five bit chunks and make sure last chunk has five bits
binary = str_split(binary, 5)
local last = table.remove(binary)
table.insert(binary, padRight(last, 5, "0"))

-- Convert each five bits to Base32 character
local encoded = {}
for i=1, #binary do
local num = tonumber(binary[i], 2)
table.insert(encoded, base32Alphabet:sub(num + 1, num + 1))
end
return padRight(table.concat(encoded), 8, "=")
end

print(base32_encode(enc))

local dec = "" --需要被解密的值
-----------------------------------------------------------
local function str_split(str, size)
local result = {}
for i=1, #str, size do
table.insert(result, str:sub(i, i + size - 1))
end
return result
end

local function dec2bin(num)
local result = ""
repeat
local halved = num / 2
local int, frac = math.modf(halved)
num = int
result = math.ceil(frac) .. result
until num == 0
return result
end

local function padRight(str, length, char)
while #str % length ~= 0 do
str = str .. char
end
return str
end

local base32Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"
function base32_decode(str)
local binary = str:gsub(".", function (char)
if char == "=" then return "" end
local pos = string.find(base32Alphabet, char)
pos = pos - 1
return string.format("%05u", dec2bin(pos))
end)

local bytes = str_split(binary, 8)

local decoded = {}
for _, byte in pairs(bytes) do
table.insert(decoded, string.char(tonumber(byte, 2)))
end
return table.concat(decoded)
end

print(base32_decode(dec))
Base 32 ( Encode ~ Decode )
--base64加密
function base64_encode(data)
local base64Table='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
return ((data:gsub('.', function(x)
local r,b='',x:byte()
for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
return r;
end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
if (#x < 6) then return '' end
local c=0
for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
return base64Table:sub(c+1,c+1)
end)..({ '', '==', '=' })[#data%3+1])
end
--base64解密
function base64_decode(data)
local base64Table='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
data = string.gsub(data, '[^'..base64Table..'=]', '')
return (data:gsub('.', function(x)
if (x == '=') then return '' end
local r,f='',(base64Table:find(x)-1)
for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
return r;
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
if (#x ~= 8) then return '' end
local c=0
for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
return string.char(c)
end))
end
Base 64 Table ( Encode ~ Decode )
local function hex(str)
str = str:gsub("#[^\n]+", "") -- remove comments
str = str:gsub("[^%x]", "") -- hex only
return str:gsub("%x%x", -- hex to
function(hex) return string.char(tonumber(hex, 16))
end)
end
if string.dump(function()end):sub(1, 12) ~= "\27Lua\81\0\1\4\4\4\8\0" then
gg.toast("This generator requires a 32-bit version of Lua 5.1")
end
Share Free 1000 file Encrypted? 😂
Does anyone need me to teach lua decoding? 😝
This media is not supported in your browser
VIEW IN TELEGRAM
Share Tutorial Mod
Detected ( found and count ) logger file by GG ?
-- custom base64 data
-- Encode
local data = "e*!jfg57yfl+[7dmrin_bt#0/g6!1y68(.xh.ata_kn3j7!un_s+jn5..a)s8xi/ou0/{ff)ec}["

-- base64
local data = "RpUpAUT80Jf6CQakfKLHz+1BSpUxFUYa/JDtdeAo4cyC1tHDx6gpazu0kdJqFdX+e4rMvfA+Ua0L"
local HEXES = '0123456789abcdef'

local function 2HEX(x)
local s, base = '', 16
local d
while x > 0 do
d = x % base + 1
x = math.floor(x / base)
s = string.sub(HEXES, d, d) .. s
end
while #s < 2 do
s = "0" .. s
end
return s
end
function math.checkIn(value, ...)
if type(arg[1]) == 'table' then
for k, v in pairs(arg[1]) do
if v == value then
return true
end
end
else
for i, v in ipairs(arg) do
if v == value then
return true
end
end
end
return false
end
This media is not supported in your browser
VIEW IN TELEGRAM
Encrypted Lua GG ( 5.0 )
-- New Update Key
-- 85℅ Encrypted Lua File
s = "17:00:00" -- time - minutes - seconds
c = os.date("%T")
if c > s then
return gg.alert("Expired","")
end
gg.alert("a")

--- install the Expired = time script
--- Very Simple Code
-- write code : Only_Zin
/lua function test(str)
local rep = ""
local tab = {}
for j in string.gmatch(str, ".") do
table.insert(tab, j)
end
local i = 1
while i <= #tab do
if tab[i - 1] == tab[i] then
rep = rep .."-".. tab[i]
else
rep = rep .. tab[i]
end
i = i + 1
end
return rep
end
for n = 0,10 do
print(test(string.rep("💘",n)))
end
/lua
function string.chunk(str, n)
local k, t
t = { }
for k in str:gmatch(string.rep( ".", n )) do
table.insert(t, k)
end
return t
end

x = "001100011100000001111000001100011220003400"
x_x = ""
for k, v in ipairs(x:chunk(4)) do
v = v .. ":"
x_x = x_x .. v
end

print(x_x)