Planetarion Forums

Planetarion Forums (https://pirate.planetarion.com/index.php)
-   Planetarion Suggestions (https://pirate.planetarion.com/forumdisplay.php?f=95)
-   -   Change to Scan IDs (https://pirate.planetarion.com/showthread.php?t=197335)

ellonweb 7 Jan 2009 21:53

Change to Scan IDs
 
For people coding external tool sites that wish to parse scans, it is rather useful to store the IDs of scans and scan groups, usually inside a database. Fortunately the biggest number an Integer (as defined by the ANSI SQL standard) can take is 2.1 billion, and so it should be no problem.

Unfortunately it seems that PA uses IDs bigger than this. Why on earth you need more than 2 billion possible IDs I do not know.

In an attempt to provide an open source and easily accessible tools set, this becomes a problem for myself and others. (In order to maintain my database agnostic stance -part of the easily accessible thing- I must accept that there is no such thing as a "BigInteger".)

Please could the code for generating these IDs be modified to resolve this problem? Shouldn't take more than 5 minutes :)

Thanks

Appocomaster 7 Jan 2009 22:13

Re: Change to Scan IDs
 
As mentioned in #support, we used an unsigned integer.
We use a wide number to make it impossible for an alliance to go through all potential numbers and 'steal' scans.

ellonweb 7 Jan 2009 23:14

Re: Change to Scan IDs
 
Thanks for discussion in #support.
In light of Cin's plans for the future I will change my storage strategy.

Zaejii 8 Jan 2009 01:51

Re: Change to Scan IDs
 
on a side note, could you get by with just using a string ellonweb? they probably use an integer in order to randomize them. since the number is already generated and won't change you can probably use a string and just concatenate the url to create a link?

Mzyxptlk 8 Jan 2009 08:13

Re: Change to Scan IDs
 
Not very elegant though.

ellonweb 8 Jan 2009 19:03

Re: Change to Scan IDs
 
Cin's future plan involves switching scan ids to alphanumerics, so yeh I'll use a string. When you think about it, the id doesn't actually represent anything, it is just a key to get at the data so while storing a number as a string is usually a horrible thing, in this case it's not so bad. And I'll be future-compatible.

On a side note Cin said the change won't be made for this round (on scans, anyway), and when it does he'll make sure to give plenty of advance warning for those operating tool sets. :up:

Cincinnatus 8 Jan 2009 19:53

Re: Change to Scan IDs
 
Quote:

Originally Posted by ellonweb (Post 3162648)
Cin's future plan involves switching scan ids to alphanumerics, so yeh I'll use a string. When you think about it, the id doesn't actually represent anything, it is just a key to get at the data so while storing a number as a string is usually a horrible thing, in this case it's not so bad. And I'll be future-compatible.

On a side note Cin said the change won't be made for this round (on scans, anyway), and when it does he'll make sure to give plenty of advance warning for those operating tool sets. :up:

i said it is unlikely that it'll happen for r30, not that it won't, and that i'd announce it to give ppl time to update their tools, nothing about "plenty of advance warning".

Mzyxptlk 8 Jan 2009 21:20

Re: Change to Scan IDs
 
ITT, Cin shows how much PA Team cares about its users. Keep up the good work, Cin!

JonnyBGood 8 Jan 2009 21:29

Re: Change to Scan IDs
 
Quote:

Originally Posted by Cincinnatus (Post 3162660)
i said it is unlikely that it'll happen for r30, not that it won't, and that i'd announce it to give ppl time to update their tools, nothing about "plenty of advance warning".

There were people who ran concentration camps who had better people skills than you.

Banned 9 Jan 2009 10:03

Re: Change to Scan IDs
 
Quote:

Originally Posted by Cincinnatus (Post 3162660)
i said it is unlikely that it'll happen for r30, not that it won't, and that i'd announce it to give ppl time to update their tools, nothing about "plenty of advance warning".

May I ask why you plan on changing to alphanumerics?

newt 9 Jan 2009 14:17

Re: Change to Scan IDs
 
I'd guess to make it even harder (re: so very unlikely that alliance techs wont consider wasting time trying) to randomly guess scan-links to 'steal' scans? Liklihood of succeeding in guessing a 10-digit alphanumeric id is same as guessing a ~15-digit numerical one. And shorter ids look nicer. Probably other reasons too :(

I like this move by pa! Don't get why cin is getting mild abuse for it, but I guess that's to be expected from the pa community.

Phil^ 9 Jan 2009 14:23

Re: Change to Scan IDs
 
Quote:

Originally Posted by Newt (Post 3162721)
Liklihood of succeeding in guessing a 10-digit alphanumeric id is same as guessing a ~15-digit numerical one. And shorter ids look nicer. Probably other reasons too :(

Probability of guessing a 10 character alphanumeric ( case insensitive ) : 1 / 36^10 = 1 / 3656158440062976
Probability of guessing a 10 character alphanumeric ( case sentitive ) : 1 / 62^10 = 1 / 839299365868340224

Probability of guessing a 15 character numeric : 1 / 10^15 = 1/ 1000000000000000

They really arent similar :)

newt 9 Jan 2009 14:38

Re: Change to Scan IDs
 
Wow! there's 26 letters in the alphabet... I was using 24, shudda paid more attention to GCSE english innit.

1/ 1000000000000000
1 / 3656158440062976

And they are more than comparable when you're discussing orders of magnitude :( Granted I didn't think of case sensitivity.

Mzyxptlk 9 Jan 2009 15:57

Re: Change to Scan IDs
 
If that is really the reason, you're solving a problem that doesn't even exist. No sane human being is going to bother finding scans in a pool of 2^32 IDs, especially when you keep in mind that it serves no practical good whatsoever.

Gabriel 9 Jan 2009 16:05

Re: Change to Scan IDs
 
Quote:

Originally Posted by Mzyxptlk (Post 3162728)
If that is really the reason, you're solving a problem that doesn't even exist. No sane human being is going to bother finding scans in a pool of 2^32 IDs, especially when you keep in mind that it serves no practical good whatsoever.

Apparently there have been attempts.

Mzyxptlk 9 Jan 2009 16:10

Re: Change to Scan IDs
 
I don't care, it's useless?

newt 9 Jan 2009 16:42

Re: Change to Scan IDs
 
I think pa are just trying to get people to stop attempting it (whether they succeed or not, the server is still getting bombarded). So decreasing the chances of guessing correctly by vast orders of magnitude should help deter the idiots.

Phil^ 9 Jan 2009 19:49

Re: Change to Scan IDs
 
tbh i would go the other way and generate a fake scan for those bombarding it with urls - just to mess with them.

Banned 9 Jan 2009 21:49

Re: Change to Scan IDs
 
Afaik (no word from Cin if this is the reason) there is a weakness in the current ID generation, and it is possible to 'steal' some scans in some fashion.

Phil^ 10 Jan 2009 15:02

Re: Change to Scan IDs
 
it boggles the mind as to how on earth something which should be as simple as a random number can be implemented wrong

Banned 10 Jan 2009 18:08

Re: Change to Scan IDs
 
Quote:

Originally Posted by Phil^ (Post 3162791)
it boggles the mind as to how on earth something which should be as simple as a random number can be implemented wrong

My guess is that they reseed it on every call with the current time.

Cincinnatus 10 Jan 2009 18:55

Re: Change to Scan IDs
 
Quote:

Originally Posted by Banned (Post 3162801)
My guess is that they reseed it on every call with the current time.

no we don't, it's a totally randomly generated numerical value, or was anyway.

ID change has been made, it applies both to scan and stored news IDs.
Both are a 15 char long alnum, so the urls and bbcode tags look like this:
show_news.pl?id=4s7hs81rladx2au
showscan.pl?scan_id=3vfbj73gleoihab
[scan]3vfbj73gleoihab[/scan]

Phil^ 10 Jan 2009 19:04

Re: Change to Scan IDs
 
those samples dont look case sensitive to me, does the implementation include capitals as well?

Heartless 11 Jan 2009 09:54

Re: Change to Scan IDs
 
Quote:

Originally Posted by Phil^ (Post 3162791)
it boggles the mind as to how on earth something which should be as simple as a random number can be implemented wrong

You might want to read Knuth and then reconsider whether a "random" number is simple or not. Granted, in this case there are quite a few less constraints on the "random" number's quality, but ultimately it is not easy to get good "random" results.

Quote:

Originally Posted by Cincinnatus (Post 3162808)
no we don't, it's a totally randomly generated numerical value, or was anyway.

I recommend you read up on how "random" numbers are computed.

Phil^ 11 Jan 2009 14:10

Re: Change to Scan IDs
 
Quote:

Originally Posted by Heartless (Post 3162829)
You might want to read Knuth and then reconsider whether a "random" number is simple or not.

Im assuming they are using perls rand() funct , which seeds on first use if not done already. Its hard to mess up if you are using a single function call without deliberately sabotaging your own efforts by reseeding
http://perl.active-venture.com/pod/func/srand.html
Quote:

Most programs won't even call srand() at all, except those that need a cryptographically-strong starting point rather than the generally acceptable default, which is based on time of day, process ID, and memory allocation, or the /dev/urandom device, if available.
On the servers, /dev/urandom should be available - plus the process id and memory allocation states should not be externally available to compromise the entropy pool

Heartless 11 Jan 2009 14:17

Re: Change to Scan IDs
 
Quote:

Originally Posted by Phil^ (Post 3162846)
*snip*

Thanks for quoting the perl documentation, now go back and read Knuth to understand what I tried to tell you. It's in Volume Two of TAOCP.

Mzyxptlk 11 Jan 2009 16:37

Re: Change to Scan IDs
 
Thing is though, even if it's not perfectly random, it doesn't really matter, because the vulnerable information is of little to no value. So instead of wasting time on coding shit like this, perhaps it would be a good idea to,oh, I dunno, improve the game?

Banned 11 Jan 2009 19:32

Re: Change to Scan IDs
 
Quote:

Originally Posted by Cincinnatus (Post 3162808)
no we don't, it's a totally randomly generated numerical value, or was anyway.

ID change has been made, it applies both to scan and stored news IDs.
Both are a 15 char long alnum, so the urls and bbcode tags look like this:
show_news.pl?id=4s7hs81rladx2au
showscan.pl?scan_id=3vfbj73gleoihab
[scan]3vfbj73gleoihab[/scan]

I hope this was done with good reason. It sucks.

Gabriel 11 Jan 2009 20:59

Re: Change to Scan IDs
 
Quote:

Originally Posted by Mzyxptlk (Post 3162855)
Thing is though, even if it's not perfectly random, it doesn't really matter, because the vulnerable information is of little to no value. So instead of wasting time on coding shit like this, perhaps it would be a good idea to,oh, I dunno, improve the game?

Agreed tbpfh.
"ZOMG I stole a scan done 4 ticks ago on a planet with 2 distorters, I'm so l33t"

Remy 12 Jan 2009 00:04

Re: Change to Scan IDs
 
Quote:

Originally Posted by Banned (Post 3162864)
I hope this was done with good reason. It sucks.

it sucks? it's about 1 minute of recoding to fix a parser....
I don't see the problem.


All times are GMT +1. The time now is 03:06.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018