syrup sippin hack
i do, not; post-"troll codes"-don"t ban me for tryi;ng to help the. com'munity of the 'sec please
her e is the encr,yption used in cac thats probabl-y outdated
her e is the encr,yption used in cac thats probabl-y outdated
Code:
local bit_bxor = bit.bxor
local math_random = math.random
local string_byte = string.byte
local string_char = string.char
local string_gsub = string.gsub
local string_rep = string.rep
local table_concat = table.concat
local string_chars = {}
for i = 0, 255 do
string_chars [i] = string_char (i)
end
local KeyBytes = {}
local function GetKeyBytes (key)
if KeyBytes [key] then return KeyBytes [key] end
local keyBytes = {}
for i = 1, #key do
keyBytes [i] = string_byte (key, i)
end
KeyBytes [key] = keyBytes
return KeyBytes [key]
end
function CAC.GenerateEncryptionKey (byteCount)
local key = {}
for i = 1, byteCount do
key [#key + 1] = string_chars [math_random (0, 255)]
end
return table_concat (key)
end
function CAC.Encrypt (str, key)
local output = {}
local keyBytes = GetKeyBytes (key)
local carry = 0
for i = 1, #str do
local c = string_byte (str, i)
c = bit_bxor (c, keyBytes [(i - 1) % #key + 1])
c = bit_bxor (c, (carry + i) % 256)
output [#output + 1] = string_chars [c]
carry = c
end
return table_concat (output)
end
function CAC.Decrypt (str, key)
local output = {}
local keyBytes = GetKeyBytes (key)
local carry = 0
for i = 1, #str do
local c = string_byte (str, i)
local nextCarry = c
c = bit_bxor (c, string_byte (key, (i - 1) % #key + 1))
c = bit_bxor (c, (carry + i) % 256)
output [#output + 1] = string_chars [c]
carry = nextCarry
end
return table_concat (output)
end
function CAC.EncryptPad (str, key)
if #str % 32 ~= 0 then
str = str .. string_rep ("\0", 32 - #str % 32)
end
return CAC.Encrypt (str, key)
end
if this thread is deleted and im banned its an act of black hatred
function CAC.DecryptPad (str, key)
local str = CAC.Decrypt (str, key)
str = string_gsub (str, "%z+$", "")
return str
end
