The Daily Click ::. Forums ::. Klik Coding Help ::. Encryption issues
 

Post Reply  Post Oekaki 
 

Posted By Message

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
7th March, 2005 at 08:34:16 -

I know how to encrypt and decrypt files using the Blowfish thingy and stuff... but I've still got a few probs with it.

Long story short, how do I detect whether or not a file is encrypted? And is there a good way to double encrypt and stuff, without possibly damaging the file's content? I wanna make a multiplayer RPG, but with multiplayer RPGs, cheating would be a major problem...

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
7th March, 2005 at 12:36:19 -

Several options:

- Look for a constant value saved in the file, e.g. if it's an INI have something like
[check]
value=12345678
To see if the file is unencrypted, see if that value exists.

- Change the filename for encrypted files. Your app would invent its own standard for this, e.g. myfile.txt (unencrypted), myfile.enc (encrypted).

- Simply always have the file encrypted. This is the most secure way too. If the files are always encrypted, you know to always unencrypt them. Unencrypt them to a temp file which you read them immediately delete, or even better decrypt with the binary object and read direct from memory if possible.

 
- Tigerworks

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
9th March, 2005 at 02:23:18 -

I've tried that first point, Tigerworks. For some reason, it tends to have partial success.. in the sense that half of the file gets recrypted and half of the file works ok. I don't know if my coding is really THAT bad (or unlucky, seeing how I did something I didn't think possible) or it's a bug or something.

Those other points are very good ideas, though. Thanks!

Now.. on to the second part of the problem. What's the most secure way to encrypt a file? I don't want to keep them in memory, as that could mean that someone would find a way to modify the stats of his/her character from there. And personally, I don't trust further encryption of an encrypted file, as that tends to screw something up. So, what's a good way?

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

SculptureOfSoul



Registered
  14/03/2005
Points
  52
23rd March, 2005 at 03:27:43 -

Bump. I too would love to know more about this from someone who has some experience. In my rpg I'm going to be loading quite a bit of data from files (tile maps for the engine, just about every stat for every character) and was wondering how to approach the problem. Loading the data isn't a problem, but the data might need to be acessible for a few minutes (during a battle, for instance). I could just load this to a temp file, make my changes and re-encrpyt it when it's done, but I fear leaving the data unencrypted for any amount of time. I'm sure the temp file would get found and modified. I could make a seperate tiny file, and just use this as a log of the changes made to the temp file. This could be encrypted and unecrypted as needed, and would be much faster than un/encrypting a huge temp file or files.

Then, before copying the temp file(s) to the original file(s), I could run through the log file and verify that the temp files match the altered values stored in the log file. If they didn't match...well, I'd have to assume that the player tampered with it. Proper recourse would be deleting all of their saved games, of course .

Any other ideas regarding how to implement un/encryption for a large scale rpg with multiple data files that are going to be accessed every battle. I've got a lot of other things that are going to be hogging up system resources, so the most efficient method would be appreciated.


 
Current Project: Undertaking the design of my mammoth RPG. Utilizing all of the knowledge gained while coding the now defunct "Shadow Reign".

Jack Galilee



Registered
  02/12/2002
Points
  990

VIP Member
23rd March, 2005 at 06:48:00 -

a good way to do it is to use the GUID object, and have somethig like an edit object run the INI/Array and find the GUID in it if not then its Encrypted the GUID object is incredibly usefull

 
The only thing better than winning gold in the paralympics is not being retarted
   

Post Reply



 



Advertisement

Worth A Click