256-bit Rbx.lua AES encryption

Hey all,
So I just finished writing this after many grueling hours of hard work. it takes any string, and encrypts it with 256-bit AES encryption.

Original code (Friend’s dubstep gun I used for a test):

–TechTeam911
–1/9/13
–WE GETTING DOWN LIKE

–Variables–
local render = game:GetService(“RunService”)
local debris = game:GetService(“Debris”)
local contentprovider = game:GetService(“ContentProvider”)
local rbx_gui = assert(LoadLibrary(“RbxGui”))
local camera = game.Workspace.CurrentCamera
local fov = camera.FieldOfView
local firstimeequipped = false

local handle = script.Parent:WaitForChild(“Handle”)
local tool = script.Parent
local character = nil
local player = game.Players.LocalPlayer
local idle_color = BrickColor.new(“Cool yellow”).Color

local active = true
local enabled = false

local danceanim = script:WaitForChild(“dance”)
local human_anim = nil
local dubstep_themeselector = script:WaitForChild(“dubstep_themeselector”):Clone()
local dubstep_script = script:WaitForChild(“dubstep_script”)

–Sugar syntax, yum.
local create_ray = Ray.new
local r3 = Region3.new
local cfn = CFrame.new
local cf_ang = CFrame.Angles
local vec3 = Vector3.new
local udim2 = UDim2.new
local instance = Instance.new
local m_huge = math.huge
local m_sin = math.sin
local math_random = math.random

–Don’t touch this.
local emitter1,emitter2 = script.Parent:WaitForChild(“emitter1”),script.Parent:WaitForChild(“emitter2”)
emitter1:WaitForChild(“SpotLight”)
emitter2:WaitForChild(“SpotLight”)
emitter1:WaitForChild(“Fire”)
emitter2:WaitForChild(“Fire”)
tool:WaitForChild(“port1”)
tool:WaitForChild(“port2”)

–Tables–

local theme_settings,themes = script.Parent:WaitForChild(“retrieve_data”):WaitForChild(“retrieve”):InvokeServer()

start_sound = instance(“Sound”)
start_sound.Name = “start_sound”
start_sound.SoundId = “http://www.roblox.com/asset/?id=142074300
start_sound.Volume = 1
start_sound.Parent = player:WaitForChild(“PlayerGui”)
running_sound = instance(“Sound”)
running_sound.Name = “running_sound”
running_sound.SoundId = “http://www.roblox.com/asset/?id=142074306
running_sound.Volume = 1
running_sound.Looped=true
running_sound.Parent = player.PlayerGui
selected_theme = theme_settings[“Vindicate - Datsik & Excision”]
start_sound.SoundId = selected_theme.start_sound
running_sound.SoundId = selected_theme.running_sound

function themeselected(item)
selected_theme = theme_settings[item]
start_sound.SoundId = selected_theme.start_sound
running_sound.SoundId = selected_theme.running_sound
end

local function outQuad(t,b,c,d)
t = t / d
return -c * t * (t - 2) + b
end

local themelist,themeselected=rbx_gui.CreateDropDownMenu(themes,themeselected)
themelist.Size = udim2(1, -25, 0.1, 0)
themelist.Position = udim2(0,0,0.1,0)
themelist.Parent = dubstep_themeselector:WaitForChild(“Frame”)
dubstep_themeselector.Parent = player:WaitForChild(“PlayerGui”)

function createwub(origin,hit)
delay(0,(function()
local explosion = (math_random(1,selected_theme.chanceofexplosion)==1)
local lastpos = origin
local direction = (hit-origin).unit
local creation_time = tick()
local selectedcolor = selected_theme.colors[math_random(1,#selected_theme.colors)]
emitter1.SpotLight.Color = BrickColor.new(selectedcolor).Color
emitter2.SpotLight.Color = BrickColor.new(selectedcolor).Color
emitter2.Fire.Color = BrickColor.new(selectedcolor).Color
emitter2.Fire.SecondaryColor = BrickColor.new(selectedcolor).Color
emitter1.Fire.Color = BrickColor.new(selectedcolor).Color
emitter1.Fire.SecondaryColor = BrickColor.new(selectedcolor).Color
local p = instance(“Part”)
p.BrickColor = BrickColor.new(selectedcolor)
if explosion then
local f = instance(“Fire”)
f.Size = 10
f.Color = BrickColor.new(selectedcolor).Color
f.SecondaryColor = BrickColor.new(selectedcolor).Color
f.Parent = p
end
local m = instance(“SpecialMesh”)
m.MeshType = “FileMesh”
m.MeshId = “http://www.roblox.com/asset/?id=1088207
m.Scale = vec3(0.1,0.1,0.1)
m.Parent = p
p.Name = “wubpart”
p.Anchored = true
p.CanCollide = false
p.Parent = character
for i = 1,m_huge do
render.RenderStepped:wait()
local ray = create_ray((origin+(direction*(selected_theme.speed*(tick()-creation_time)))+vec3(0,m_sin(tick()-creation_time)(selected_theme.speedselected_theme.wubratio),0)),directionselected_theme.speed/20)
local hit,pos = game.Workspace:FindPartOnRayWithIgnoreList(ray,{character})
if (p ~= nil and (origin-p.Position).magnitude >= 1000) then
p:Destroy()
break
elseif hit == nil then
for _,v in pairs(game.Workspace:GetChildren()) do
if not v:FindFirstChild(“dubstep_script”) and ((v:FindFirstChild(“VehicleSeat”) ~= nil and (v.VehicleSeat.Position-p.Position).magnitude <= selected_theme.range) or (v:FindFirstChild(“Torso”) and v:FindFirstChild(“Humanoid”) ~= nil and v ~= character and (v.Torso.Position-p.Position).magnitude <= selected_theme.range)) then
local dub = dubstep_script:Clone()
dub.Parent = v
dub.Disabled = false
end
end
p.CFrame = cfn(origin+(direction
(selected_theme.speed*(tick()-creation_time)))+vec3(0,m_sin(tick()-creation_time)(selected_theme.speedselected_theme.wubratio),0),origin+(direction*(selected_theme.speed*(tick()+1/60-creation_time)))+vec3(0,m_sin(tick()-creation_time)(selected_theme.speedselected_theme.wubratio),0))cf_ang(math.pi/2,0,0)
elseif hit then
print(hit)
if explosion then
e = instance(“Explosion”)
e.BlastRadius = selected_theme.range/2
e.BlastPressure = 0
e.Position = pos
e.Parent = game.Workspace
end
local Point1 = pos-vec3(selected_theme.range,selected_theme.range,selected_theme.range)
local Point2 = pos+vec3(selected_theme.range,selected_theme.range,selected_theme.range)
region = r3(Point1,Point2)
local region3_detection = game.Workspace:FindPartsInRegion3(region,character,100)
for _,v in pairs(region3_detection) do
if not v:FindFirstChild(“Fire”) and v.Parent:FindFirstChild(“Humanoid”) == nil and v.Parent:FindFirstChild(“VehicleSeat”) == nil and not v.Parent:IsA(“Tool”) and not v.Parent:IsA(“Hat”) and not v.Locked and (v.Size.X+v.Size.Z)/2 <= selected_theme.mass_range then
if explosion then
v.Anchored = false
v:BreakJoints()
local f = instance(“Fire”)
f.Size = v.Size.Y
2
f.Color = BrickColor.new(selectedcolor).Color
f.SecondaryColor = BrickColor.new(selectedcolor).Color
f.Heat = 10
f.Parent = v
v.Velocity = vec3(math_random(-100,100),math_random(-100,100),math_random(-100,100))
debris:AddItem(v,5)
end
v.BrickColor = BrickColor.new(selectedcolor)
end
end
p:Destroy()
break
end
end
end))
end

script.Parent.Equipped:connect(function()
enabled = true
local mouse = game.Players.LocalPlayer:GetMouse() – The glitches of Roblox force me to do this.
emitter1.SpotLight.Color = idle_color
emitter2.SpotLight.Color = idle_color
emitter1.Fire.Color = idle_color
emitter1.Fire.SecondaryColor = idle_color
emitter2.Fire.Color = idle_color
emitter2.Fire.SecondaryColor = idle_color
character = tool.Parent
human_anim = character:WaitForChild(“Humanoid”):LoadAnimation(danceanim)
bg = instance(“BodyGyro”)
bg.maxTorque = vec3(m_huge,m_huge,m_huge)
bg.cframe = cfn(character:WaitForChild(“Torso”).Position,mouse.Hit.p)
bg.Parent = character.Torso
dubstep_themeselector:WaitForChild(“Frame”):TweenPosition(udim2(0,0,0.5,-150),“Out”,“Quad”,0.25,true)
mouse.Move:connect(function()
bg.cframe = cfn(character.Torso.Position,mouse.Hit.p)
end)
script.Parent.Deactivated:connect(function()
active = false
enabled = false
running_sound:Stop()
start_sound:Stop()
human_anim:Stop()
render.RenderStepped:wait()
camera.FieldOfView = 70
emitter1.SpotLight.Color = idle_color
emitter2.SpotLight.Color = idle_color
emitter1.Fire.Color = idle_color
emitter1.Fire.SecondaryColor = idle_color
emitter2.Fire.Color = idle_color
emitter2.Fire.SecondaryColor = idle_color
emitter1.Fire.Enabled = false
emitter2.Fire.Enabled = false
enabled = true
end)
if not firstimeequipped then
–ADMINS, FIX YOUR #### WITH THE TOOL CONNECTIONS.
firstimeequipped = true
script.Parent.Activated:connect(function()
if enabled and not active then
render.RenderStepped:wait()
active = true
start_sound:Play()
print(“Start sound playing”)
for i = 1/60,selected_theme.startupdelay,(1/60) do
render.RenderStepped:wait()
if not active then
break
else
camera.FieldOfView = outQuad(i,70,-20,selected_theme.startupdelay)
end
end
if not active then
camera.FieldOfView = 70
else
human_anim:Play()
running_sound:Play()
for i = 0.25,1/60,-(1/60) do
render.RenderStepped:wait()
if not active then
break
else
camera.FieldOfView = outQuad(i,70,-20,0.25)
end
end
emitter1.Fire.Enabled = true
emitter2.Fire.Enabled = true
while active do
local wub_temp = math_random(selected_theme.wubdelay_min,selected_theme.wubdelay_max)/100
createwub(script.Parent.port1.Position+(script.Parent.port1.CFrame.lookVector*2),mouse.Hit.p)
for i = 0,wub_temp,1/60 do
wait(1/30)
if not active then
break
else
camera.FieldOfView = outQuad(i,70,-20,wub_temp)
end
end
for i = wub_temp/2,0,-1/60 do
render.RenderStepped:wait()
if not active then
break
else
– For all easing functions:
– t = elapsed time
– b = begin
– c = change == ending - beginning
– d = duration (total time)
camera.FieldOfView = outQuad(i,70,-20,wub_temp/2)
end
end
end
end
end
end)
end
end)

script.Parent.Unequipped:connect(function()
enabled = false
bg:Destroy()
active = false
enabled = false
start_sound:Stop()
running_sound:Stop()
human_anim:Stop()
render.RenderStepped:wait()
camera.FieldOfView = 70
dubstep_themeselector.Frame:TweenPosition(udim2(0,-300,0.5,-150),“Out”,“Quad”,0.25,true)
emitter1.Fire.Enabled = false
emitter2.Fire.Enabled = false
end)

Result of encryption:

├«l6├ê+e.├▓┬ç├ª├║├ñy├½┬│├ê├«<├┐^Bdc┬ë┬╡┬Ç(S┬í?├¿Q/┬â┬│├╛├▓┬«#Cq├ÿ├í┬┤├Ä8┬╢V├å’┬í┬░┬╢Wnn├╜3o┬ï┬ó’├òe $k+├ÿ├ùV┬îB├▓u├ä┬▓
)ñá¢X˜ð“¹ñšW”6âôÁ6M/&H—ñ…†–œëõßþàoß^/h×æz(º‡£’ŽšáÀAôwmš…Wm¥dÒ)¸CÂvP$Ûëq2Ņ#å
b€˜quŗ$²ùS´ gŸÞýc{UÖO2¿=Ep¼UÃ;klòB+§n_eAs$D.€Ç¸a©{T£¿;Î;,J8b´Qn]êæÆ]mú[ãƒ
í£¢ôk[uuÌq¼’€8J#Q7;K&ԟþp÷²kàÁ‹äaÇVž{ ãºån†²m¤ˆ›œ‹\6¿Ã µÝi·ìˆ;Ij¶o ¸ÔÊ÷D6òŸ¤8¦øºˆ˜S”³‰úcÕJV/N‚¡¡áœ›‡õL¨+Úð •ÒЛ÷ É ŠÄܦe½§9ܞ˜|úE¬0‹p¶ç_°|ÐUœã?Ãa7ÐAëæ×1¸]¼ðeΏSY\0+wºµGµAû·„>_“Ôë4a·ƒlËÞ×{VI¢ÈÏڗFAÒññ‘Ô6-ɜ€M‡Vgl^blácž•cV;€——f¿]$)I1Šãéԋ\‰ç¡µ-®³üÕôéY.1"TZ.ø‹y¡t–¥°(ôxfe¸ª oPHæe,5º;Ÿ‘Q7qJë.Kžù«Üñ…<OÀ£…Nɖȃ?žþâeÚÔdüM–Œ4z-ŽÑún[Ž²X {”™ |¿ø(ð¼¨bÂw_{n“.
mÕ·1ŠwJã<¥CÙ%‚aéoë,Wdòe;ß"ÅsIë(\˜ï€^2߈ˆ_¨Ñlé‰ϔ·ËÇ5bëò,ï}ZÁ*-.(dÍlÍ+ÿ,RĻ\ÜCÖ
¹Ë$¢Úþõ4• LMyéxÂæ >g @Îå aÔ4mW¼DkeŠSâšIŠˆŒVþåàF,D‚^6Á™ÓB3ˆ•â…z
Attempting to decrypt ├«l6├ê+e.├▓┬ç├ª├║├ñy├½┬│├ê├«<├┐^Bdc┬ë┬╡┬Ç(S┬í?├¿Q/┬â┬│├╛├▓┬«#Cq├ÿ├í┬┤├Ä8┬╢V├å’┬í┬░┬╢Wnn├╜3o┬ï┬ó’├òe $k+├ÿ├ùV┬îB├▓u├ä┬▓
)ñá¢X˜ð“¹ñšW”6âôÁ6M/&H—ñ…†–œëõßþàoß^/h×æz(º‡£’ŽšáÀAôwmš…Wm¥dÒ)¸CÂvP$Ûëq2Ņ#å
b€˜quŗ$²ùS´ gŸÞýc{UÖO2¿=Ep¼UÃ;klòB+§n_eAs$D.€Ç¸a©{T£¿;Î;,J8b´Qn]êæÆ]mú[ãƒ
í£¢ôk[uuÌq¼’€8J#Q7;K&ԟþp÷²kàÁ‹äaÇVž{ ãºån†²m¤ˆ›œ‹\6¿Ã µÝi·ìˆ;Ij¶o ¸ÔÊ÷D6òŸ¤8¦øºˆ˜S”³‰úcÕJV/N‚¡¡áœ›‡õL¨+Úð •ÒЛ÷ É ŠÄܦe½§9ܞ˜|úE¬0‹p¶ç_°|ÐUœã?Ãa7ÐAëæ×1¸]¼ðeΏSY\0+wºµGµAû·„>_“Ôë4a·ƒlËÞ×{VI¢ÈÏڗFAÒññ‘Ô6-ɜ€M‡Vgl^blácž•cV;€——f¿]$)I1Šãéԋ\‰ç¡µ-®³üÕôéY.1"TZ.ø‹y¡t–¥°(ôxfe¸ª oPHæe,5º;Ÿ‘Q7qJë.Kžù«Üñ…<OÀ£…Nɖȃ?žþâeÚÔdüM–Œ4z-ŽÑún[Ž²X {”™ |¿ø(ð¼¨bÂw_{n“.
mÕ·1ŠwJã<¥CÙ%‚aéoë,Wdòe;ß"ÅsIë(\˜ï€^2߈ˆ_¨Ñlé‰ϔ·ËÇ5bëò,ï}ZÁ*-.(dÍlÍ+ÿ,RĻ\ÜCÖ
¹Ë$¢Úþõ4• LMyéxÂæ >g @Îå aÔ4mW¼DkeŠSâšIŠˆŒVþåàF,D‚^6Á™ÓB3ˆ•â…z

Yes, it does decrypt - you just have to specify the password as one of the arguments. The AES encryption library is composed of seven module scripts.

Code I used for testing encryption/decryption:

local encrypt_lua = require(script:WaitForChild(“library”):WaitForChild(“encrypt_lua”));

arg = {“Test”,“Testdata”,32,4}

local text = [[
–TechTeam911
–1/9/13
–WE GETTING DOWN LIKE

–Variables–
local render = game:GetService(“RunService”)
local debris = game:GetService(“Debris”)
local contentprovider = game:GetService(“ContentProvider”)
local rbx_gui = assert(LoadLibrary(“RbxGui”))
local camera = game.Workspace.CurrentCamera
local fov = camera.FieldOfView
local firstimeequipped = false

local handle = script.Parent:WaitForChild(“Handle”)
local tool = script.Parent
local character = nil
local player = game.Players.LocalPlayer
local idle_color = BrickColor.new(“Cool yellow”).Color

local active = true
local enabled = false

local danceanim = script:WaitForChild(“dance”)
local human_anim = nil
local dubstep_themeselector = script:WaitForChild(“dubstep_themeselector”):Clone()
local dubstep_script = script:WaitForChild(“dubstep_script”)

–Sugar syntax, yum.
local create_ray = Ray.new
local r3 = Region3.new
local cfn = CFrame.new
local cf_ang = CFrame.Angles
local vec3 = Vector3.new
local udim2 = UDim2.new
local instance = Instance.new
local m_huge = math.huge
local m_sin = math.sin
local math_random = math.random

–Don’t touch this.
local emitter1,emitter2 = script.Parent:WaitForChild(“emitter1”),script.Parent:WaitForChild(“emitter2”)
emitter1:WaitForChild(“SpotLight”)
emitter2:WaitForChild(“SpotLight”)
emitter1:WaitForChild(“Fire”)
emitter2:WaitForChild(“Fire”)
tool:WaitForChild(“port1”)
tool:WaitForChild(“port2”)

–Tables–

local theme_settings,themes = script.Parent:WaitForChild(“retrieve_data”):WaitForChild(“retrieve”):InvokeServer()

start_sound = instance(“Sound”)
start_sound.Name = “start_sound”
start_sound.SoundId = “http://www.roblox.com/asset/?id=142074300
start_sound.Volume = 1
start_sound.Parent = player:WaitForChild(“PlayerGui”)
running_sound = instance(“Sound”)
running_sound.Name = “running_sound”
running_sound.SoundId = “http://www.roblox.com/asset/?id=142074306
running_sound.Volume = 1
running_sound.Looped=true
running_sound.Parent = player.PlayerGui
selected_theme = theme_settings[“Vindicate - Datsik & Excision”]
start_sound.SoundId = selected_theme.start_sound
running_sound.SoundId = selected_theme.running_sound

function themeselected(item)
selected_theme = theme_settings[item]
start_sound.SoundId = selected_theme.start_sound
running_sound.SoundId = selected_theme.running_sound
end

local function outQuad(t,b,c,d)
t = t / d
return -c * t * (t - 2) + b
end

local themelist,themeselected=rbx_gui.CreateDropDownMenu(themes,themeselected)
themelist.Size = udim2(1, -25, 0.1, 0)
themelist.Position = udim2(0,0,0.1,0)
themelist.Parent = dubstep_themeselector:WaitForChild(“Frame”)
dubstep_themeselector.Parent = player:WaitForChild(“PlayerGui”)

function createwub(origin,hit)
delay(0,(function()
local explosion = (math_random(1,selected_theme.chanceofexplosion)==1)
local lastpos = origin
local direction = (hit-origin).unit
local creation_time = tick()
local selectedcolor = selected_theme.colors[math_random(1,#selected_theme.colors)]
emitter1.SpotLight.Color = BrickColor.new(selectedcolor).Color
emitter2.SpotLight.Color = BrickColor.new(selectedcolor).Color
emitter2.Fire.Color = BrickColor.new(selectedcolor).Color
emitter2.Fire.SecondaryColor = BrickColor.new(selectedcolor).Color
emitter1.Fire.Color = BrickColor.new(selectedcolor).Color
emitter1.Fire.SecondaryColor = BrickColor.new(selectedcolor).Color
local p = instance(“Part”)
p.BrickColor = BrickColor.new(selectedcolor)
if explosion then
local f = instance(“Fire”)
f.Size = 10
f.Color = BrickColor.new(selectedcolor).Color
f.SecondaryColor = BrickColor.new(selectedcolor).Color
f.Parent = p
end
local m = instance(“SpecialMesh”)
m.MeshType = “FileMesh”
m.MeshId = “http://www.roblox.com/asset/?id=1088207
m.Scale = vec3(0.1,0.1,0.1)
m.Parent = p
p.Name = “wubpart”
p.Anchored = true
p.CanCollide = false
p.Parent = character
for i = 1,m_huge do
render.RenderStepped:wait()
local ray = create_ray((origin+(direction*(selected_theme.speed*(tick()-creation_time)))+vec3(0,m_sin(tick()-creation_time)(selected_theme.speedselected_theme.wubratio),0)),directionselected_theme.speed/20)
local hit,pos = game.Workspace:FindPartOnRayWithIgnoreList(ray,{character})
if (p ~= nil and (origin-p.Position).magnitude >= 1000) then
p:Destroy()
break
elseif hit == nil then
for _,v in pairs(game.Workspace:GetChildren()) do
if not v:FindFirstChild(“dubstep_script”) and ((v:FindFirstChild(“VehicleSeat”) ~= nil and (v.VehicleSeat.Position-p.Position).magnitude <= selected_theme.range) or (v:FindFirstChild(“Torso”) and v:FindFirstChild(“Humanoid”) ~= nil and v ~= character and (v.Torso.Position-p.Position).magnitude <= selected_theme.range)) then
local dub = dubstep_script:Clone()
dub.Parent = v
dub.Disabled = false
end
end
p.CFrame = cfn(origin+(direction
(selected_theme.speed*(tick()-creation_time)))+vec3(0,m_sin(tick()-creation_time)(selected_theme.speedselected_theme.wubratio),0),origin+(direction*(selected_theme.speed*(tick()+1/60-creation_time)))+vec3(0,m_sin(tick()-creation_time)(selected_theme.speedselected_theme.wubratio),0))cf_ang(math.pi/2,0,0)
elseif hit then
print(hit)
if explosion then
e = instance(“Explosion”)
e.BlastRadius = selected_theme.range/2
e.BlastPressure = 0
e.Position = pos
e.Parent = game.Workspace
end
local Point1 = pos-vec3(selected_theme.range,selected_theme.range,selected_theme.range)
local Point2 = pos+vec3(selected_theme.range,selected_theme.range,selected_theme.range)
region = r3(Point1,Point2)
local region3_detection = game.Workspace:FindPartsInRegion3(region,character,100)
for _,v in pairs(region3_detection) do
if not v:FindFirstChild(“Fire”) and v.Parent:FindFirstChild(“Humanoid”) == nil and v.Parent:FindFirstChild(“VehicleSeat”) == nil and not v.Parent:IsA(“Tool”) and not v.Parent:IsA(“Hat”) and not v.Locked and (v.Size.X+v.Size.Z)/2 <= selected_theme.mass_range then
if explosion then
v.Anchored = false
v:BreakJoints()
local f = instance(“Fire”)
f.Size = v.Size.Y
2
f.Color = BrickColor.new(selectedcolor).Color
f.SecondaryColor = BrickColor.new(selectedcolor).Color
f.Heat = 10
f.Parent = v
v.Velocity = vec3(math_random(-100,100),math_random(-100,100),math_random(-100,100))
debris:AddItem(v,5)
end
v.BrickColor = BrickColor.new(selectedcolor)
end
end
p:Destroy()
break
end
end
end))
end

script.Parent.Equipped:connect(function()
enabled = true
local mouse = game.Players.LocalPlayer:GetMouse() – The glitches of Roblox force me to do this.
emitter1.SpotLight.Color = idle_color
emitter2.SpotLight.Color = idle_color
emitter1.Fire.Color = idle_color
emitter1.Fire.SecondaryColor = idle_color
emitter2.Fire.Color = idle_color
emitter2.Fire.SecondaryColor = idle_color
character = tool.Parent
human_anim = character:WaitForChild(“Humanoid”):LoadAnimation(danceanim)
bg = instance(“BodyGyro”)
bg.maxTorque = vec3(m_huge,m_huge,m_huge)
bg.cframe = cfn(character:WaitForChild(“Torso”).Position,mouse.Hit.p)
bg.Parent = character.Torso
dubstep_themeselector:WaitForChild(“Frame”):TweenPosition(udim2(0,0,0.5,-150),“Out”,“Quad”,0.25,true)
mouse.Move:connect(function()
bg.cframe = cfn(character.Torso.Position,mouse.Hit.p)
end)
script.Parent.Deactivated:connect(function()
active = false
enabled = false
running_sound:Stop()
start_sound:Stop()
human_anim:Stop()
render.RenderStepped:wait()
camera.FieldOfView = 70
emitter1.SpotLight.Color = idle_color
emitter2.SpotLight.Color = idle_color
emitter1.Fire.Color = idle_color
emitter1.Fire.SecondaryColor = idle_color
emitter2.Fire.Color = idle_color
emitter2.Fire.SecondaryColor = idle_color
emitter1.Fire.Enabled = false
emitter2.Fire.Enabled = false
enabled = true
end)
if not firstimeequipped then
–ADMINS, FIX YOUR #### WITH THE TOOL CONNECTIONS.
firstimeequipped = true
script.Parent.Activated:connect(function()
if enabled and not active then
render.RenderStepped:wait()
active = true
start_sound:Play()
print(“Start sound playing”)
for i = 1/60,selected_theme.startupdelay,(1/60) do
render.RenderStepped:wait()
if not active then
break
else
camera.FieldOfView = outQuad(i,70,-20,selected_theme.startupdelay)
end
end
if not active then
camera.FieldOfView = 70
else
human_anim:Play()
running_sound:Play()
for i = 0.25,1/60,-(1/60) do
render.RenderStepped:wait()
if not active then
break
else
camera.FieldOfView = outQuad(i,70,-20,0.25)
end
end
emitter1.Fire.Enabled = true
emitter2.Fire.Enabled = true
while active do
local wub_temp = math_random(selected_theme.wubdelay_min,selected_theme.wubdelay_max)/100
createwub(script.Parent.port1.Position+(script.Parent.port1.CFrame.lookVector*2),mouse.Hit.p)
for i = 0,wub_temp,1/60 do
wait(1/30)
if not active then
break
else
camera.FieldOfView = outQuad(i,70,-20,wub_temp)
end
end
for i = wub_temp/2,0,-1/60 do
render.RenderStepped:wait()
if not active then
break
else
– For all easing functions:
– t = elapsed time
– b = begin
– c = change == ending - beginning
– d = duration (total time)
camera.FieldOfView = outQuad(i,70,-20,wub_temp/2)
end
end
end
end
end
end)
end
end)

script.Parent.Unequipped:connect(function()
enabled = false
bg:Destroy()
active = false
enabled = false
start_sound:Stop()
running_sound:Stop()
human_anim:Stop()
render.RenderStepped:wait()
camera.FieldOfView = 70
dubstep_themeselector.Frame:TweenPosition(udim2(0,-300,0.5,-150),“Out”,“Quad”,0.25,true)
emitter1.Fire.Enabled = false
emitter2.Fire.Enabled = false
end)
]]

print(“Trying to run”)
local start_time = tick()
local cipher = encrypt_lua.encrypt(arg[1],text,arg[3],arg[4]);
print(“Encrypting string '”…text…“'”)
print("Encrypted string : "…cipher)
local m = Instance.new(“Message”)
m.Text = (“Took “…math.floor(tick()-start_time)…” seconds to encrypt string.”)
m.Parent = game.Workspace
local start_time = tick()
print(“Attempting to decrypt “…cipher…” with password '”…arg[1])
local plain = encrypt_lua.decrypt(“Test”,cipher,32,4);
if (plain == nil) then
print(“Invalid password.”);
else
print("Result of decryption: "…plain)
print(“Took “…math.floor(tick()-start_time)…” seconds to decrypt string.”)
end

It’s not efficient (I blame rbx.lua, even though I already used syntactic sugar with it), but it does a great job at encrypting/decrypting any string values.

I’ll make it open-sourced later on, but I’m still finishing it up.

4 Likes

I do love encryption, but could you explain why this is useful? :frowning:

3 Likes

Imagine being able to encrypt localscripts, and basically make them unreadable - pull the master key from the server, and use loadstring() on the result of the decryption cipher.

2 Likes

I’m also working on a Rbx.lua MD5 hasher right now.

1 Like

I made it free, have fun.

8 Likes

How would you go about doing this? I’ve tried doing a few little works, but nothing seems to be communicated straight form the server to the client as I tried.