.X files encryption?

Started by
18 comments, last by kevinawad 15 years, 4 months ago
How is it possible to encrypt .X files? or actually .bmp files then run them using directx? This is really needed for selling applications or games. How is that possible?
Advertisement
The same way you'd encrypt any files? Just decrypt them when you go to load them.

Quote:Original post by kevinawad
This is really needed for selling applications or games.


I don't agree that it is "really needed". Most games do not encrypt anything and rely on copyright law to ensure people don't steal their assets.
You can encrypt the data however you want, so long as you can decrypt it and then feed the binary data to D3DXLoadMeshFromXInMemory.

Keep in mind that any encryption scheme you could use is breakable.
I'd concentrate more on making your game than worrying about people stealing it, at this point in time.


Possible? Yeah. Worth it? Probably not.
I'm talking about an online game...people would just mess around with files...

how will it be possible to read each data example of a texture...i know how to decrypt, but how to manage to make it while loading from files..or after loading the file. Where's the data located?
Quote:Original post by kevinawad
how will it be possible to read each data example of a texture...i know how to decrypt, but how to manage to make it while loading from files..or after loading the file. Where's the data located?


When a files is decrypted you can do one of two things, ether leave it in the memory and pass a pointer to it, or write it into a temporary file.

As far as online gaming your best bet is not single file encryption, it would be best done with a customized database file, but that can be very cumbersome in the first stages of game development.

-Stev0
Quote:Original post by kevinawad
I'm talking about an online game...people would just mess around with files...
Why would that matter? The player will only be modifying their own local copy of the game, and you'll be verifying all movement, etc on the server anyway to prevent cheating / hacking anyway.

Quote:Original post by kevinawad
how will it be possible to read each data example of a texture...i know how to decrypt, but how to manage to make it while loading from files..or after loading the file. Where's the data located?
1. Load encrypted file into memory
2. Decrypt into another memory buffer
3. Pass the memory buffer to D3DXCreateTextureFromFileInMemory, etc.
Well, you could also try to use some sort of checksum on the client files as well, to see if they have been tampered, but Evil Steve is right - you will most likely have to do a lot of your validation on the server anyway.
Quote:Original post by Moe
use some sort of checksum on the client files as well, to see if they have been tampered
I reckon this is your best bet. Implementing a CRCn algorithm is pretty simple and you can have the client upload the resultant values to the server at which point it decides to accept/refuse the connection accordingly.

This can double-up as a method for checking if the client is the correct version as well. If the files are wrong then you can auto-download the latest patch (etc..) and then attempt a re-connect.

Ultimately though you're only creating a deterant against the lazy - just look at the amount of effort some commercial games go to in order to stop hacking, and then look at how many of them still fail. Where there's a will, there's a way [wink]

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:Original post by jollyjeffers
Quote:Original post by Moe
use some sort of checksum on the client files as well, to see if they have been tampered
I reckon this is your best bet. Implementing a CRCn algorithm is pretty simple and you can have the client upload the resultant values to the server at which point it decides to accept/refuse the connection accordingly.


But if the client is already hacked, they can just send whatever checksum the server is expecting. No need to calculate it.

There is, unfortunately, nothing you can do to protect the client-side assets. All you can do on the server is ensure that the client isn't doing anything that is "impossible" (walking through walls, etc) based on what the client-side assets should be.

This topic is closed to new replies.

Advertisement