I'm sure there's an easier way to do this, but hey

It's 11:52 PM here, I'm glad I'm still awake...
local scramble = function(theString)
local outputTable = {}
local scramblerTable = {}
for i = 1, #theString do
local char = string.sub(theString, i, i)
local newID = false
while (function()
local inUse = not newID
for key, value in pairs(scramblerTable) do inUse = (value == newID) or inUse end
return inUse
end)() do
newID = math.random(1, #theString * 1000)
end
outputTable[newID] = char
scramblerTable[#scramblerTable + 1] = newID
end
table.sort(scramblerTable, function(a, b ) return a < b end)
local theOutput = ""
for key, value in pairs(scramblerTable) do theOutput = theOutput .. outputTable[value] end
return theOutput
end
print(scramble("Hello World"))