nikitafloy Posted June 17, 2016 Share Posted June 17, 2016 Hello, i need in script which can protect my DFF, TXD files from theft. I read about teaEncode/Decode, but how can i do it? My attempts failed. Link to comment
Bean666 Posted June 17, 2016 Share Posted June 17, 2016 never seen a server with dff/txd protection. Link to comment
Noki Posted June 18, 2016 Share Posted June 18, 2016 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 AlexTMjugador Posted June 18, 2016 Discord Moderators Share Posted June 18, 2016 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
nikitafloy Posted June 18, 2016 Author Share Posted June 18, 2016 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now