Jump to content
  • Advertisement
Sign in to follow this  
kevinawad

.X files encryption?

This topic is 3664 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!