08-04-2009, 05:48 PM
People can just decrypt the game and use your encryption mechanism to do the job for them, so I would suggest only looking at a simple encryption.
Actually I would suggest you compress the data. You can encrypt the compressed data if you want.
If you use save_data and load_data to put the object into a file you can use this instead:
Save
Load
You can also consider adding a checknum which is derived from the data. That way you can immediately notice if the data has been tampered with assuming they haven't changed the checknum accordingly. If you want to see a use look at my Collect Letters project.
*hugs*
- Zeriab
Actually I would suggest you compress the data. You can encrypt the compressed data if you want.
If you use save_data and load_data to put the object into a file you can use this instead:
Save
Code:
data = Zlib::Deflate.deflate(Marshal.dump(object))
save_data(object, filename)
Load
Code:
data = load_data(filename)
object = Marshal.load(Zlib::Inflate.inflate(data))
You can also consider adding a checknum which is derived from the data. That way you can immediately notice if the data has been tampered with assuming they haven't changed the checknum accordingly. If you want to see a use look at my Collect Letters project.
*hugs*
- Zeriab