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.

DarkBASIC Discussion / Encrypting your text files

Author
Message
Hobgoblin Lord
19
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 17th Dec 2005 04:56 Edited at: 4th Mar 2006 17:05
Hello;

I write alot of RPG's and I have had a little problem with players checking out my text files to get info on the game of modify saved characters and the like, hey I can't blame them I might do the same thing so I came up with a couple of functions to scramble the text and descramble it. Hope you find it useful



Assuming your text is just standard characters such as those represented on the keyboard a value of -30 to 127 should be safe for the encryption key. I use the encrypter in a utility to load the file rename it and then save it scrambled. Tell me what ya think
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 17th Dec 2005 05:21
You could have one variable that looks like your money or something, and have that variable always stay the same. Then check to see if the amount is the same.

Or use that number, and have it be like your money multiplied by a cetain number. So if the two numbers aren't equal, you know they messed with it, and you correct it, and take off a bit of money if you want. Hope I'm saying this clearly. If not, I'll try to make an example.

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Dec 2005 13:10 Edited at: 17th Dec 2005 13:10
So what you're doing actually, is increasing the characters ASCII by "code" and change it back in a character.

That's a nice idea.

Can I suggest you use rnd()? As you know, randomize nr changes the root number of the sequence of rnd(), which can be used in your advantage.

for example,
To encrypt:
the first 3 characters determine the root of the randomize(randomize root) Every other ascii character is increase with a random number.

To decrypt:
the first 3 characters determine the root of the randomize. Every other ascii character is decreased with a random number.

The root number is in both cases the same, which means the same sequence will be used every time you call rnd().

Also, this root number can be encrypted again which makes it almost impossible to break it.
Hobgoblin Lord
19
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 17th Dec 2005 13:56 Edited at: 17th Dec 2005 14:00
Good idea Sven, I have a question though.

If the first three characters are changed when encrpted say from ABC to XYZ does the seed for rnd change by the same amount? otherwise the new random number would not be the same and the decrypt would be wrong. or are you suggesting not to encrypt the first three characters and use them as the key only?

Don't know if I am being clear here

Thanks

{EDIT}
WOO HOO!!!!!
Sorry for the unrelated content here but after two months of posting I am finally off the newbie post list ~Does a Jig~
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Dec 2005 15:55
It is possible to encrypt the first 3 characters, but it isn't possible to use the random values to encrypt that too, because you don't have a root value.

And, yes changing the ABC to XYZ will cause the whole word to be different. But that's a disadvantage for the guy that wanted to crack it.

Login to post a reply

Server time is: 2025-05-22 23:54:35
Your offset time is: 2025-05-22 23:54:35