FIXD: question!! Also, DAMMIT just kidding. you can now choose to read it or not.

Posted by Alert Games on April 13, 2012, 11:57 a.m.

zOMG a programming question! Also, the questions processing form doesnt work so…

So I was looking around the interwebs and trying stuff out, but I figured maybe has a better method to saving a secure game save.

I started using RC4 for the encryption, however i think that it creates a newline character (or something that game maker [yes, i know] reads as one). So I was thinking theres really only one other way to do this then.

Aside from using a checksum on the file, which I will do anyway, I think the only other way is to parse a long string and 'explode' it to get the different values and assign them to the variables.

So simply put, I would write a binary file, then when i read it, convert it into a string and parse that string using a delimiter and assign it back to the variables.

Is this a good idea or is there a better way?

EDIT: ok why is the title input max character so big when it trims the title anyway

Comments

sirxemic 12 years, 7 months ago

First you talk about using RC4 for encryption, then you talk about using a checksum, then you talk about exploding the string.

So "Is there a better way?" doesn't make any sense. What are you trying to achieve? Better way than what?

Zhiko 12 years, 7 months ago

Pro Tip: If people have no idea what you're trying to do, there's probably a better way to do it.

Alert Games 12 years, 7 months ago

oh i must have missed that h/o OH. It was in the title of the question post that wasnt working. >_>

Lorik 12 years, 7 months ago

My first thought on seeing this was that it was some kind of attempt at a noise generator for the whole 'procedural world development' bandwagon thing going on, but then newline characters could be trivially replaced if all you wanted was noise.

So I didn't comment until you put on the seriousface and asked for feedback. Is GM still having weird save file issues or something? I stopped using it when a decompiler leaked out and some jerk was going around distributing peoples' sources without permission, which was forever ago.

Alert Games 12 years, 7 months ago

No saving files works fine. But I think when trying to make encrypted save files some of the characters are read as newlines.

In terms of the decompiler, theres an anti-decompiler, and also an obfuscator to protect your source much more than raw exported exe's.

But my question I guess could extend to other programming, which is why I called it a "programming question". How are secure game saves usually or generally done?

Lorik 12 years, 7 months ago

Never had to do it, but I'd probably go with converting the data to string format and using some form of home-brewed cipher. Unless you specifically leave the newline byte pattern out of your cipher or do a pass where you replace it with something else, you're probably going to continue to get those.

Alert Games 12 years, 7 months ago

that would require going out of the byte range as rc4 uses the full range IIRC

Lorik 12 years, 7 months ago

…which is one reason I'd probably be using a home brew cipher and not rc4.

Alert Games 12 years, 7 months ago

yeah im already using one for sending information online. But are there any more… specialized ones on the web? I tried looking for some but I couldn't find any.

Lorik 12 years, 7 months ago

It's also another reason I don't use Game Maker anymore, come to think of it. Unless it's gotten a lot more transparent in recent updates, you don't know how some of its built-in functions are going to parse your specific bytes.