What is the best string encryption algorithm?

I’ve been using the Adonis string encryption and decryption algorithm for a few months now and have seen flaws from it. One of the flaws was returning an error for a certain amount of encrypted string. I was wondering what other string encryption algorithms will support longer encrypted strings. Any thoughts and ideas?

Perhaps you can encrypt and decrypt segments at a time. This should work if the encryption function return a string of the same length. Otherwise you may have to change the decrypt function’s split length.

local LEN = 100
function split(str, len)
    local a = {}
    while str:len()>len do
        a[#a+1] = str:sub(1, len)
        str = str:sub(len+1)
    end
    table.insert(a, str)
    return a
end

function encrypt(str)
    local result = ""
    for _, segment in next, split(str, LEN) do
        result = result .. yourEncryptFuntion(segment)
    end
    return result
end
function decrypt(str)
    local result = ""
    for _, segment in next, split(str, LEN) do
        result = result .. yourDencryptFuntion(segment)
    end
    return result
end

What is your purpose of encrypting strings? I find encryption completely useless as what you’re trying to do is make it so an exploiter can’t access it, yet they can. If you have a method of encrypting you also have a method of decrypting, meaning it can be bypassed. It’s just a matter of time before someone finds out the encryption.

If you’re using it to name Instances consider it a waste of time as they can be called directly through other means. If you’re using it for Tables or Remote data it can also be bypassed.

If you’re using it for storing it to DataStores you’re just wasting valuable space (that was actually thankfully raised recently) in the DataStore.

Instead of encryption just make the data completely useless unless the server verifies the Client.

Also, this thread already exists, with answers.

Since you shouldn’t ask for methods of doing something since that’s not how the Developer Forum works, you should really think of these suggestions made by me and the people on this other post as some of them are very useful.

PS: If you’re making a game where the client has to figure out what the encryption string is for like a puzzle game, post 4 on that thread I posted is really going to be your best bet.

Well, I find encryption very useful for sending encrypted info without having the exploiter to understand. The forum you considered isn’t a faster alternative, yet I’m looking for something faster than the AES-256 module. I once tried that module and it wasn’t quite considerable despite of its encryption & decryption process taking excessive amount of time.

Encrypting info is never the way to go when stopping exploiters. For small games, this would probably work (because no one would bother to try). Exploiters can see the source of scripts. They do not have to fire remotes directly. If you are using a ModuleScript and that module provides the functions such as AddCoins(), they could very easily call that function directly. If you are using ‘keys’ to secure your remote, they can block that remote from firing, and save that key so they can fire it with different arguments.

1 Like