Is there a better way to encrypt information to send across client and server than this?

I already know that modern exploits can view a version of client-sided code that functions similar to the original. I decided to make a module script anyway, it prevents newbie exploiters from breaching remote security.

local module = {}
module.__index = module
function module.encode(str)
	local fin = {}
	if type(str) == "string" then
	for i = 1,#str do
		local add = string.sub(str,i,i)
			local adda = string.byte(add)/6.9848684798687548094756
		table.insert(fin,#fin+1,adda)
	end
	end
	return fin
end
function module.decode(str)
	local fin = ""
	if type(str) == "table" then 
	for i,v in ipairs(str) do
			local new = v*6.9848684798687548094756
		local add = string.char(new)
		local adda = fin..add
		fin = adda
	end
	end
	return fin
end
return module

Are there any better methods of encryption that I don’t know of?

3 Likes

You can probably find tons of methods by just searching online something like “encryption algorithm.” There are too many to count.

Also, that long constant stops being accurate after about the 13th digit, so there’s no point in having it that long.

With that said, as long as you are employing the proper server checks, then encryption shouldn’t be needed to begin with.

6 Likes

Can’t they require this module script and use the encode/decode?

6 Likes

You can always swap things with a key and then translate it into another language like Japanese. Also for every second character you can insert a random letter or number. This means they will have to translate it first and then they will see that its a complete jumble.

To revert it you would just have to translate it back, remove every second character and then use your key to turn it back.

2 Likes

Don’t be using resources on stuff like this, Just make sure your remote are secure and you’ll not need to waste resources like this D:

2 Likes

Certain remote event usage is very hard to secure.

Then think of it in another way, Try and figure out methods and that to get around that barrier.