Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Author(s): Nettoork#0000
- Version: 1.3
- ]]--
- table.encrypt = function(tableC, password, password2)
- if not tableC or not password or not password2 or type(tableC) ~= 'table' or password == '' or password2 == '' then return end
- local initSeed, finalString, newMessage, key = '', '', '', ''
- for i in password:gmatch('.') do
- initSeed = initSeed..i:byte()
- end
- for i in password2:gmatch('.') do
- key = key..i:byte()
- end
- math.randomseed(initSeed)
- otherSeed = math.random(1000000)
- local action = pcall(function()
- for i, v in next, tableC do
- if type(v) == 'string' or type(v) == 'number' then
- if type(v) == 'string' then
- v = [[']]..v..[[']]
- end
- newMessage = newMessage..' '..v..' '..i:upper()
- else
- return
- end
- end
- newMessage = newMessage..' '..key
- for i in newMessage:gmatch('.') do
- local newByte = i:byte() + 68 + math.random(5)
- otherSeed = otherSeed + i:byte()
- math.randomseed(otherSeed)
- if (newByte >= 65 and newByte <= 122) and not (newByte >= 91 and newByte <= 96) then
- newByte = string.char(newByte)
- end
- finalString = finalString..newByte
- end
- end)
- math.randomseed(os.time())
- if not action then
- return
- else
- return finalString
- end
- end
- table.decrypt = function(stringC, password, password2)
- if not stringC or not password or not password2 or type(stringC) ~= 'string' or password == '' or password2 == '' then return end
- local initSeed, finalString, aByte, key = '', '', '', ''
- for i in password:gmatch('.') do
- initSeed = initSeed..i:byte()
- end
- for i in password2:gmatch('.') do
- key = key..i:byte()
- end
- math.randomseed(initSeed)
- otherSeed = math.random(1000000)
- local action = pcall(function()
- for i in stringC:gmatch('.') do
- if i:byte() >= 65 and i:byte() <= 122 then
- local newByte = i:byte() - 68 - math.random(5)
- otherSeed = otherSeed + newByte
- math.randomseed(otherSeed)
- finalString = finalString..string.char(newByte)
- else
- aByte = aByte..i
- if aByte:len() >= 3 then
- local newByte = tonumber(aByte) - 68 - math.random(5)
- otherSeed = otherSeed + newByte
- math.randomseed(otherSeed)
- finalString = finalString..string.char(newByte)
- aByte = ''
- end
- end
- end
- end)
- math.randomseed(os.time())
- if not action then
- return
- else
- local finalTable, stage, fsLength, aString, aNumber = {}, 0, 0
- for i, v in string.gmatch(finalString, '[^%s]+') do
- fsLength = fsLength + 1
- end
- for i, v in string.gmatch(finalString, '[^%s]+') do
- stage = stage + 1
- if stage == fsLength and i ~= key then
- return
- elseif aString then
- if aString:sub(-1) == [[']] then
- finalTable[i:lower()] = aString:gsub([[']], '')
- aString = nil
- else
- aString = aString..' '..i
- end
- elseif aNumber then
- finalTable[i:lower()] = aNumber
- aNumber = nil
- elseif i:sub(1, 1) == [[']] then
- aString = i
- else
- aNumber = i
- end
- end
- return finalTable
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment