Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (784)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (858)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Simple hiscore encryption  (Read 2846 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Posted 2004-05-11 10:11:22 »

Hiscores are nothing fancy, but I really need to be able to persist them between games, othewise they're not much use. How have others done this?

My first thought would be to write the output as text ('cos then its nice and easy to parse) and encrypt it somehow, but I'm not sure if theres any built-in encryption that I can lay my hands on.

Second thought would be to stick the text into a zip file and stick a password on the zip, but I can't see any functionality for using passwords on zip files Sad

Lastly (and weakest) would be just to write the output as binary and hope people can't really be bothered looking at it closely...

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Online princec

« JGO Spiffy Duke »

Medals: 1067
Projects: 3
Exp: 20 years

Eh? Who? What? ... Me?

« Reply #1 - Posted 2004-05-11 11:16:59 »

If you just serialize it as normal Java serialized data no-one's going to look at it.

Cas Smiley

Offline abies

Senior Devvie

« Reply #2 - Posted 2004-05-11 11:50:51 »

At work, I use persistence scheme which serialized objects to database and after a year I'm able to recognize a lot of info by just looking at binary dump  Wink

Easiest IMHO would be to gzip stream and then just do something so header will not be recognized - prepend it with few bytes, or xor entire stream with some arbitrary algorithmic serie. Compression is good enough to scare away any people looking for localized changes for specific field differences. Just make sure that they are not automatically opened in Total Commander Smiley

Artur Biesiadowski
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline cfmdobbie

Senior Devvie

Medals: 1

Who, me?

« Reply #3 - Posted 2004-05-11 12:02:59 »

...and any obfuscation you add is irrelevant the moment someone decompiles the source.

If it's important that no one alters the saved data, you wouldn't be writing the app in Java and wouldn't be running it on the client.  Go for something simple that takes no time to implement, and just ignore those who try to mess with things.

Hellomynameis Charlie Dobbie.
Offline darcone

Junior Devvie

Size matters

« Reply #4 - Posted 2004-05-11 21:05:34 »

Yeah, and make the highscore only list last few days entries so that cheaters will have to do it every week (in which case you can identify and hopefully ban them)
Offline D.t.O

Junior Devvie

Psych'd about Java Games

« Reply #5 - Posted 2004-05-12 00:49:29 »

If you feel like it, use javax.crypto. Quite simple to use, I can show you an example if you want.

Or, you can amuse yourself by inventing your own encryption scheme. Combine Caesar with some other simple algorithms, and it'll be kinda hard to break.

If people can decompile your bytecode, however, it's a different story. Sad

     - D.t.O
Offline JuddMan

Senior Devvie

Medals: 1

Your Ad Here

« Reply #6 - Posted 2004-05-13 12:18:03 »

imo, unless there are prizes to be won, i would just zip it, or not even bother. i remember editing the hiscore file in minesweeper a few years back (they prevent that now), and so what if my time was amazing or whatever...

seing as the hiscore would be on the client in your case, i guess there aren't giveaways involved, so let the nuts out there have their hollow bragging rights.
Pages: [1]
  ignore  |  Print  

hadezbladez (1623 views)
2018-11-16 13:46:03

hadezbladez (638 views)
2018-11-16 13:41:33

hadezbladez (1613 views)
2018-11-16 13:35:35

hadezbladez (330 views)
2018-11-16 13:32:03

EgonOlsen (2675 views)
2018-06-10 19:43:48

EgonOlsen (2940 views)
2018-06-10 19:43:44

EgonOlsen (1640 views)
2018-06-10 19:43:20

DesertCoockie (2348 views)
2018-05-13 18:23:11

nelsongames (2252 views)
2018-04-24 18:15:36

nelsongames (2947 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!