Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Encode/Decode (https://forums.graalonline.com/forums/showthread.php?t=77654)

bscharff 11-21-2007 06:18 AM

Encode/Decode
 
I'm developing an advanced rights system to help kill abuse on my server.

Using base64encode("bscharff"), the encoding translates to 'YnNjaGFyZmY=' (notice it ends with a '=')

As everyone knows (hopefully), to assign variables to something, you use an equals sign. Therefor, I cannot save with base64 encoding.

Is there any other encoding available in GS2 other than base64?

Novo 11-21-2007 06:27 AM

Quote:

Originally Posted by bscharff (Post 1359641)
I'm developing an advanced rights system to help kill abuse on my server.

Using base64encode("bscharff"), the encoding translates to 'YnNjaGFyZmY=' (notice it ends with a '=')

As everyone knows (hopefully), to assign variables to something, you use an equals sign. Therefor, I cannot save with base64 encoding.

Is there any other encoding available in GS2 other than base64?

PHP Code:

string "="

Umm... As long as the '=' is in quotes, it shouldn't be a problem.

Tolnaftate2004 11-21-2007 06:30 AM

Quote:

Originally Posted by Novo (Post 1359642)
PHP Code:

string "="

Umm... As long as the '=' is in quotes, it shouldn't be a problem.

Can you make a variable with name "var="? I think that's what he's getting at.

Novo 11-21-2007 06:35 AM

Quote:

Originally Posted by Tolnaftate2004 (Post 1359643)
Can you make a variable with name "var="? I think that's what he's getting at.

Ah... Umm... ereg_replace anyone? =D

Yea... Don't encode the account names... First off, they hide who has what rights -- And in terms of manageability, it's a useless overhead. You're much more likely to leave an ex-staff in the rights if you don't see his account in the first place. ( thus, increasing abuse! )

I don't see how it'll help you in any way by doing so: Anyone can easily find their account info with encode, and it just delays them... About 3 seconds.

Otherwise, it's quite a bad habit.

I would just log all actions, and if one isn't justified, than there you go! You have a log about it. ( and you could take counter-measures. )

coreys 11-21-2007 06:57 AM

Encoding is honestly only good for passwords and the like. And I wouldn't use base64encode by itself for anything that you want secure, since there is a base64decode function, rendering it completely useless by itself, honestly.

Inverness 11-21-2007 09:15 AM

You don't need to encode, why not use an md5 hash or something.

napo_p2p 11-21-2007 11:24 AM

  • Best Option: Limit the access to the weapon(s), then you wouldn't need to waste time on an "advanced rights system."
  • Next Best Option: Use an md5 hash (like Inver said). The command is md5(str).

Twinny 11-21-2007 01:15 PM

I asked for an encryption method that could pass a key as a parameter but it never got anywhere. Ultimately, the idea was put forward that a key could be how many times you keep re-encoding it in a loop.

If someone knows how to get that variable, using the encode function won't do much at all :rolleyes: . In the end, It would be better to just stop scripting rights systems for time-wasting and unnecessary staff systems.

coreys 11-21-2007 06:53 PM

Quote:

Originally Posted by Inverness (Post 1359656)
You don't need to encode, why not use an md5 hash or something.

Exactly.

bscharff 11-21-2007 07:04 PM

Quote:

Originally Posted by Tolnaftate2004 (Post 1359643)
Can you make a variable with name "var="? I think that's what he's getting at.

That's EXACTLY What I'm Getting At.
The Variable is rights_bscharff and It would translate to rights_(I forget)=
and a variable cannot have '=' in it

bscharff 11-21-2007 07:08 PM

"time-wasting"..."unnecessary staff systems."
No. It Is Completely Necessary.
Don't Reply unless you intend to help.

M'Kay.
If I'm Making My Own Encode/Decode Script, How Would I basically tokenize each character on it's own? (without manually adding spaces)

Crow 11-21-2007 07:32 PM

Why do you double post all the time? Just use MD5 hashes ;o

Skyld 11-21-2007 07:38 PM

On behalf of this thread, I wrote an encryption/decryption example. It is simple and by no means industry standard, and it will almost certainly produce characters that are not allowed in variable names, so think about how you are going to use it. I guess it could be adapted to replace such characters with more variable-name friendly ones but I didn't have time to think about that.

Take a look at http://skyld.vip.graal.net/wikka.php...mpleEncryption.

It was a quickly written script, and probably can be made more efficient, but I hope it demonstrates the idea.

bscharff 11-22-2007 01:52 AM

Thanks Skyld!

Kyranki 11-22-2007 03:13 AM

Actually, staff systems usually aren't really that important. :p Or necessary at that...

Inverness 11-22-2007 03:40 AM

Uh, I've never heard of anyone (Staff with the weapon) actually hacking rights out of a staff weapon, its not really worth the effort considering you'd just get fired.

If you're wasting this much time working on some super staff script and not on developing the server then you're a bad staff member.

Tigairius 11-22-2007 03:42 AM

Quote:

Originally Posted by bscharff (Post 1359724)
"time-wasting"..."unnecessary staff systems."
No. It Is Completely Necessary.
Don't Reply unless you intend to help.

Quote:

Originally Posted by Kyranki (Post 1359812)
Actually, staff systems usually aren't really that important. :p Or necessary at that...

Speaking of things that aren't necessary... why post such an unnecessary comment that is almost irrelevant to the topic at hand: encoding and decoding?

Inverness 11-22-2007 03:45 AM

Quote:

Originally Posted by Tigairius (Post 1359817)
Speaking of things that aren't necessary... why post such an unnecessary comment that is almost irrelevant to the topic at hand: encoding and decoding?

Almost isn't good enough. And he doesn't need a reason to post either.

Edit: Here's a rephrasing. Why does it matter? He's not going to stop posting just because you don't like the necessity of his post, so it isn't really necessary to bring up the necessity of his posting.

Inverness 11-22-2007 03:58 AM

Quote:

Originally Posted by Tigairius (Post 1359821)
I don't see me saying anywhere that he needs a reason to post things.

Me neither. See my edit.

Twinny 11-22-2007 10:39 AM

Quote:

Originally Posted by Kyranki (Post 1359812)
Actually, staff systems usually aren't really that important. :p Or necessary at that...

It's just a combination of small, basic scripts piled into one behemoth of a script. Most commands don't actually have a logical use. It's worse when it's a combination of scripts stolen from multiple sources. Multiple coding styles clash and the **** hits the fan.

Kyranki 11-22-2007 08:15 PM

Quote:

Originally Posted by Twinny (Post 1359848)
It's just a combination of small, basic scripts piled into one behemoth of a script. Most commands don't actually have a logical use. It's worse when it's a combination of scripts stolen from multiple sources. Multiple coding styles clash and the **** hits the fan.

Sounds like a computer talking badass Twinny lol :p

bscharff 11-23-2007 08:55 PM

Second at Tigairius (& Inverness)

Pimmeh 11-23-2007 09:26 PM

Quote:

Originally Posted by bscharff (Post 1360035)
Second at Tigairius (& Inverness)

Whats the point of this post?

Inverness 11-24-2007 12:46 AM

Quote:

Originally Posted by bscharff (Post 1360035)
Second at Tigairius (& Inverness)

I don't understand what you're trying to say, elaborate.

bscharff 11-24-2007 05:31 AM

Like if someone agrees to something they say "second"
I'm saying I Agree With Tigairius & Inverness :P

Inverness 11-24-2007 08:54 AM

Quote:

Originally Posted by bscharff (Post 1360107)
Like if someone agrees to something they say "second"
I'm saying I Agree With Tigairius & Inverness :P

How? We're not even agreed on the same thing.

I'm confused now :confused:

cbk1994 11-25-2007 02:15 AM

Quote:

Originally Posted by Inverness (Post 1360119)
How? We're not even agreed on the same thing.

I'm confused now :confused:

He's trying to confuse you. He's messing with your mind. Be strong.


I only encrypt things that are being used in real-time, so to say. For example, encrypting the ammo you have with base64encode x ammount of times, then decoding it x ammount of times. This simply makes it harder to use CheatEngine, etc


All times are GMT +2. The time now is 08:17 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.