Jump to content

Protection DFF, TXD files


Recommended Posts

On the server side, you can encode the .dff/.txd files with teaEncode and send them to the client (you can encode the actual files, or load the files in when the resource starts and perform the encoding - I would do the former). Once they have been downloaded, you can send the key you used to encode them to the client. Once you have all that, decode the mods and load the replacements in memory.

I haven't done it before, but this is the way I would go about making this system.

Link to comment
  • Discord Moderators
On the server side, you can encode the .dff/.txd files with teaEncode and send them to the client (you can encode the actual files, or load the files in when the resource starts and perform the encoding - I would do the former). Once they have been downloaded, you can send the key you used to encode them to the client. Once you have all that, decode the mods and load the replacements in memory.

That's right, I have done something like that on a script I made for a server and it works pretty well.

I would recommend encoding the actual files in a separate folder once, so the server doesn't have to encode requested files over and over again when players want them, saving CPU and RAM in the long term. To make sure that the encoded file cache is up-to-date with the original files, you can compute hashes of the data and store them in a file when the resource starts: if they change, the file has changed too. That is a fast operation if you use something like MD5, even if your mods take 100 MB or more.

However, if you want more security that the TEA algorithm provides, you can use AES Lua libraries (which are slow) or, better yet, an asymmetric key algorithm like RSA.

Link to comment

I have average knowledge of English. Create how i can understand u. thx.

so

dont download

server

local dff = teaEncode('taxi.dff', 'anywords') 
local txd = teaEncode('taxi.txd', 'anywords') 
  
setTimer(function() 
    triggerClientEvent('send_this_files', resourceRoot, dff, txd) 
end, 1000,1) 

client

function sendIt(dff, txd) 
    downloadFile(txd) 
    downloadFile(dff) 
end 
addEvent('send_this_files', true) 
addEventHandler('send_this_files', getRootElement(), sendIt) 

meta

    

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...