unity –  serialize information from C# in a non-human-readable approach?

unity – serialize information from C# in a non-human-readable approach?

[ad_1]

Is that this gibberish sufficient?

Hexe editor view of some binary data

That is simply the JSON generated by my reply to your earlier query, which I then compressed to a zipper file (lowering its dimension by half as a bonus), and renamed so it isn’t so apparent that it is only a zip.

That’s, I began with this textual content in a file known as data1.save:

{
    "record": [
        {
            "rid": 1000
        },
        {
            "rid": 1001
        },
        {
            "rid": 1002
        }
    ],
    "references": {
        "model": 2,
        "RefIds": [
            {
                "rid": 1000,
                "type": {
                    "class": "MixedSerializer/ObjectA",
                    "ns": "",
                    "asm": "Assembly-CSharp"
                },
                "data": {
                    "a": "apple"
                }
            },
            {
                "rid": 1001,
                "type": {
                    "class": "MixedSerializer/ObjectB",
                    "ns": "",
                    "asm": "Assembly-CSharp"
                },
                "data": {
                    "b": 42
                }
            },
            {
                "rid": 1002,
                "type": {
                    "class": "MixedSerializer/ObjectC",
                    "ns": "",
                    "asm": "Assembly-CSharp"
                },
                "data": {
                    "c": 3.141590118408203,
                    "toggle": false
                }
            }
        ]
    }
}

So the compression does a superb job of hiding the apparent/acquainted construction seen above.

Somebody with good information of the zip format would be capable of acknowledge its signature by peeking on the bytes, however “your common Joe” would probably already assume this isn’t a human-editable file and quit.

(Fun reality, MS Workplace docs use this trick too: for those who rename a .docx Phrase doc or .pptx PowerPoint slideshow to .zip, you possibly can unzip it to search out human-readable recordsdata and folders inside. If you happen to by no means although to try this with a doc, most of your gamers won’t ever suppose to do it with a save file both)

You may make this a little bit bit tougher by operating a distinct compression algorithm that is not so readily built-into each PC’s OS, however the common level is: compressed information is not very human-readable, and can in all probability delay the kind of person you are attempting to discourage.

You get diminishing returns for those who attempt to add extra obfuscation than this. Even for those who put in high-security grade encryption, your sport essentially has to incorporate the encryption key to have the ability to learn and write the save recordsdata. So in case you have a computer-savvy adversary, you’ve got handed them each the lock and the important thing. With sufficient willpower, they will all the time extract your sport’s decryption routine and use it themselves to switch the info, until you do all of your saving on a server you management, so the important thing by no means touches the participant’s system. Perhaps try this in case you have actual cash concerned, like playing functions. However for many video games you are prone to be making, it isn’t price that effort.

[ad_2]

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply