-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMAZI-Crypt-API.lua
More file actions
47 lines (46 loc) · 1.21 KB
/
Copy pathMAZI-Crypt-API.lua
File metadata and controls
47 lines (46 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
local function byte(vl)
local output = ''
for i=1,#vl do
local a = string.sub(vl,i,i)
output = output..string.char(string.byte(math.random(97, 122)))..string.byte(a)
end
return output
end
getgenv().encrypt = function(secret,data)
local output = ''
local vl = {}
local charact = 'abcdefghijklmnopqrstuvwxyz'
local number = '1234567890'
local characttable = {}
local numbertable = {}
if data == '' then
data = 'nil'
-- data = string.char(string.byte(math.random(97, 122)))
end
if #data < 3 then
data = data..'123'
end
for i=1,#data do
local a = string.upper(string.sub(data,i,i))
vl[i] = secret..a..string.reverse(secret)
vl[i] = string.reverse(vl[i])..secret
end
for i=1,#vl do
output = output..''..vl[i]..byte(vl[i])
end
if #output > 128 then
output = string.sub(output,1,128)
end
for i=1,#number do
local a = string.sub(number,i,i)
numbertable[i] = a
end
for i=1,#charact do
local a = string.sub(charact,i,i)
characttable[i] = a
end
for i,v in pairs(characttable) do
output = string.gsub(output, i, v)
end
return output
end