Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] Basic Data Encryption

Author
Message
HeavyAmp
17
Years of Service
User Offline
Joined: 25th Oct 2006
Location: Castle in the Sky!
Posted: 29th Nov 2007 05:28 Edited at: 5th Dec 2007 18:05
This is a simple demonstration on how to encrypt data for your game. If you want to use this to encrypt data for your game then expand on it to make it a bit harder to crack .



Zotoaster's/Kaedroho's Improved Version:



Better to be dead, than to live your life afraid.
Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 30th Nov 2007 18:18
Nice. Not exactly going to fool MI5, but if, say, i'm putting my game story bits into text files and don't want someone reading them outside the game, this would work.

SUPER BADASS SPACESHIP X: WEBSITE
FORUM TOPIC
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Nov 2007 18:50
Pretty cool, though I think you over-did your code a bit. It's easier to forget about the arrays and just do something like this:



"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
HeavyAmp
17
Years of Service
User Offline
Joined: 25th Oct 2006
Location: Castle in the Sky!
Posted: 2nd Dec 2007 08:19
Thanks Mr Tank and Zotoaster . That alot more efficient coding Zotoaster I think ill update it tomorrow with your code too tired atm.

Better to be dead, than to live your life afraid.
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 2nd Dec 2007 17:55
Very good, Replace the top 3 lines with this


HeavyAmp
17
Years of Service
User Offline
Joined: 25th Oct 2006
Location: Castle in the Sky!
Posted: 5th Dec 2007 00:10
Done and Done. When You compare each version together you will notice that it encrypts it differently. I can't figure out why. They should both change the ASCII by 10 but you can see it encodes it differently.

Better to be dead, than to live your life afraid.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 5th Dec 2007 15:33
Seems that in the original, when you encrypt, you took away 10 rather than added it on, vice versa. My bad I guess

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
HeavyAmp
17
Years of Service
User Offline
Joined: 25th Oct 2006
Location: Castle in the Sky!
Posted: 5th Dec 2007 18:02 Edited at: 5th Dec 2007 18:09
@Zotoaster
ah thats what it was couldn't figure out why it was different. I was a bit tired last night, quite easy to overlook the addition symbol for a minus.

@WindowsKiller
Is that what it is called. I basically followed the tutorial on GameDev. I was surprised how similar the commands are between DarkBasic and VisualBasic.

http://www.gamedev.net/reference/articles/article1602.asp

Just been Reading up on ROT13

http://en.wikipedia.org/wiki/ROT13

Better to be dead, than to live your life afraid.

Login to post a reply

Server time is: 2024-05-17 17:51:56
Your offset time is: 2024-05-17 17:51:56