Jump to content
  • Advertisement
Sign in to follow this  
toan1982

What and how to encrypt / decrypt X files ???

This topic is 4253 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

hi all, Sorry if i wrong place for my asking in here. i have question about encrypt and decrypt a X file (export from maya). when my app run, i would like to encrypt all X files inside my app, and when people click to load any character (represented by an X file) then my app will decrypt and then load the X file. I donot know what is best way to encrypt and decrypt a X file. And how to do this??? Any can help me how to do??? Thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
Saving to a big binary file then load in memory and use D3DXLoadMeshFromXInMemory loading it, just guess.

[Edited by - glsensor on February 1, 2007 1:07:47 AM]

Share this post


Link to post
Share on other sites
So at application run time, you want to load the .x file into memory, encrypt it, only to decrypt it again when you need to use the .x file?

Why do you need to do this, if you don't mind me asking?

Share this post


Link to post
Share on other sites
Guest
You could do like this:

encryption: search for a complex algorhytm on the net or do something simple like this:
// anything you want here, for example
#define some_formula_here(x) ((x) * (x) - 2 * (x) + 5)

-to encrypt:
enc_byte = original_byte + some_formula_here(file_position);
-to decrypt:
original_byte = enc_byte - some_formula_here(file_position);

To save:

- use an encryption function (made by you) to make, let's say, an .enc file from an .x file;

To load:

- use the decryption function to read and reverse the .enc file and to put it in a temporary file (which now will containing the normal .x stuff);
- now, read and load that temporary file with the DXLoadMeshFromX function;
- delete or empty the temporary file.

PS: that temp file can have a generic name and be used for enc/dec other files too.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!