Archived

This topic is now archived and is closed to further replies.

jtmerchant

File Security and Personalization

Recommended Posts

I know basically how to read/write to a .txt file, but how exactly would one make their own types of files, and how would you "encrypt" a file so that only your decrypting function could read it? What I''m assuming for the encryption is that, if there is no predefined way of doing so, I''ll have some code that has my own personalized "language" or encryption type and has a formula that calculates the translation when you wish to read it. Opinionated feedback requested. Thanks, Joshua Merchant

Share this post


Link to post
Share on other sites
As far as I was aware, 'you're own file type' to me would just me different methods of reading the file. Structure wise the file would be structured in different ways depending on what is written and in what order.

As far as encryption goes you should check up on some tutorials that gamedev has, they can best explain it.

But, other then that, I'm about as lost as you are.

[edited by - PumpkinPieman on November 15, 2003 11:00:05 AM]

Share this post


Link to post
Share on other sites
Your own file format is essentially made however your wish to. You basically have a set of data you wish to archive, and how you write is what determines your "format". If you wish to create files other than text files, you need to work with binary files.

As for encryption, there are many algorithms that already exist. If you want your data to be secure, using your own "method" is most likely NOT secure. Even if the person trying to access the data does not know the method of encryption, your method will probably not survice any seriour cryptanalytic attack. You are better off to look up standard methods on the web (ie DES, Triple-DES, IDEA, Blowfish etc...). You should be able to find some free libraries around which you could just use directly.

The above methods work on a key system. The data is encrypted with the key you select, and can only be decrypted with that same key. As a rule of thumb, the strength of the encryption method is better the larger the key is. For example, DES (Data Encryption Standard) uses a key length of 56 bits. Early on, this was deemed to be sufficiently secure. However, with the increase in computer speed and the availability of distributed computing, 56-bit keys are no longer considered secure. However, for your purposes, it may be fine. If you find a DES algorithm, you can always encrypt the data with more than one key.

Mike

Share this post


Link to post
Share on other sites