Results 1 to 10 of 10
  1. #1
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default Store information

    Hello everyone,
    I wonder what is the best way to store information for a client side program.
    Let's say that it's a game and I want to save the records on the client folder.
    So saving it on a txt file will let the user change the records easly.
    The only thing that pop on my mind is encryption, I know what it is but never worked with it so I'm not sure if it's that right place to use it.
    Thanks in advanced.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,875
    Rep Power
    25

    Default Re: Store information

    How smart are the clients?
    You could store the data in binary.

  3. #3
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default Re: Store information

    I have no idea how smart they are.
    But if they notice that it's binary they will be able to reverse it into txt right?or it's not possible?
    oops .. it's must be possible cause if I want to read this binary file I have to reverse/decode it.
    I'm speaking theoretically, as you can see I don't even know how to do it yet xD.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,875
    Rep Power
    25

    Default Re: Store information

    You could encode it so that they would need to know java and see your java code to be able to figure out the contents of the file.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Store information

    saving it on a txt file will let the user change the records easly.
    A question for you: how does that hurt you? If you're not planning to offer some tangible reward for a high score, let the users tamper all they want.

    But if you are planning some reward scheme, don't store the data on the player's computer at all. No scheme is entirely immune from hacking.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  6. #6
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default Re: Store information

    how does that hurt you?
    I used to play Icy Tower when I was young (client side game, not online) and when I found a way to "cheat" the game I stoped playing and just used that trick/hack.
    So that won't hurt me directly but when people will be able to edit the game by changing values from the notepad they might stop having fun playing it and in the end they will stop which is hurting me.

    You could encode it
    Ok, so what kind of encode should I use? All I know about encoding is that you change your data by some formula and send it.
    When you want to do something with it, you have to do the opposite, reverse the code to the original.
    So the diffrenec between the encoding types is the formula that change the data right?
    There is also something with keys, ok this is definitely not my speciality.
    Would you mind to explaining me which encode should I use?do I have to implement the encoding algorithm or it's an class on java.

    Thank you again.

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,875
    Rep Power
    25

    Default Re: Store information

    If you store the numeric data in binary instead of text, that will make it much harder for anyone to change. You would need to be able to do binary arithmetic and have a hex editor to change the file.

  8. #8
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    4

    Default Re: Store information

    Thank you so much.
    So all I left to do is to learn how to convert data into binary and the opposite right?

  9. #9
    Join Date
    Feb 2012
    Location
    Delhi, India
    Posts
    5
    Rep Power
    0

    Default Re: Store information

    learning converting to binary data is not a big deal... but i will suggest that u should apply some other logics also to make ur encryption key more strong... a question for norm : even a newbie in java can write a simple java program in which he will create a new inputStream and read the binary data 16 bits i.e. 2 bytes at a time n converting the same to desired decimal number format... encryption is crakeddddddd so easily :-P

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,875
    Rep Power
    25

    Default Re: Store information

    Numeric data in a program is in binary already. No need to convert it. If the data is int, write and read it as int data.
    Often numeric data is converted to a String when writing it to a text file.

Similar Threads

  1. Replies: 3
    Last Post: 12-11-2011, 08:22 PM
  2. Replies: 5
    Last Post: 04-27-2011, 10:14 PM
  3. Need information...
    By nikkka in forum New To Java
    Replies: 1
    Last Post: 03-07-2011, 03:25 PM
  4. Extract xml to store into db
    By palanikumark in forum Advanced Java
    Replies: 3
    Last Post: 06-06-2008, 04:09 PM
  5. Replies: 3
    Last Post: 04-07-2008, 07:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •