Any plugin for this? JSON encrypt.

  • Hello, please, does anyone know if there is a plugin to encrypt JSON data ?.

    I have used the search engine but I have not found anything.

    My game will save information in JSON and I need to encrypt it so that the user can not alter it.

  • There were a post couple days ago by the dude who's making the bagel game (or something like this, Lou iirc). He asked about the same thing. The only way to do this is basically validate the data with a hash.

    For example, you send 3 infos on the json: player_name, plays and score. By having another info, lets say, checksum, you can validate on server side if the 3 info matches the checksum.

    For the checksum you can use kyatric's hash plugin and maybe use SALT+PLAYER_NAME+PLAYS+SCORE, having the salt being know both by the game and the server.

    Actually, theres another way: to compute the score on server or basically simulating if the score is achievable.

    This concern/problem is not a construct specific thing; the problem here is the ease for users to see/change the values.

  • Thanks for the info, although I expected a plugin to exist. Godot can encrypt the JSON data. Why can not C2 ?.

    I do not understand very well the way you describe me because you talk about a server ?.

  • I thought u'd be using the json to save the data on a server.

    Well, there are many things godot and other engines can do and construct don't but also the vice-versa.

    But, afterall, i indeed don't understand why construct doesnt have a simple hash function.

    Whats your scenario, exactly? What kind of data you want to store/encrypt? Do you need to "decrypt" it?

  • I'm doing a 1 vs 1 game with online and local mode.

    The player wins rounds and unlocks levels and characters, that information should be saved on disk.

    File that stores the following data:

    Player's name

    unlocked characters

    unlocked levels

    won rounds

    So I think that I have to store this information locally, so I thought about using JSON.

    But if I do not encrypt the data, the player could alter it and unlock everything.

  • I see, but why don't you store it on a server?

    You could use gamesparks for example. They're even free (with limits, but really high).

    Anyway, with the hash idea i gave to you, this is achievable:

    player_name

    characters_unlocked

    levels_unlocked

    rounds_won

    hash

    On your first layout (i suppose this is where you load the data into the dictionary/array youre using right?) you validate if a md5/sha1 hash of the 4 first infos (plus a SALT) matches the given (json) hash.

  • Sorry, that's all there is.

  • scirra.com/forum/viewtopic.php

    Sorry, that's all there is.

    Ok thanks for this guys!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • scirra.com/forum/viewtopic.php

    Sorry, that's all there is.

    Nice!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)