Forums / General Questions / Change the way order nubmer is generated

Change the way order nubmer is generated

Locked

Views: 756

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
31 Aug 2010, 12:43 AM
#1
cindy2010 avatar

cindy2010

Zen Follower

Join Date:
Apr 2010
Posts:
100
Plugin Contributions:
0

Change the way order nubmer is generated

Does anyone know if there is a way to change how the order number is generated? I believe currently it is just a sequence, which is really bad since people can easily guess how many orders you have.

I think, at least, we can change it to something like:
Current_timestamp-A_random_number
Or something like that.

This is also the case for customer ID: I can easily sign up as a customer today, and sign up as another customer 1 week later, then know how many customers the site has during this week. This is really bad.

Thanks.

31 Aug 2010, 10:14 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Change the way order nubmer is generated

You'd have to rewrite the code which assigns those numbers - not exactly a simple job.

I guess I don't understand why either of those things would be 'really bad'. Most customers don't care how much business you're doing as long as your site looks professional and your prices are good, and I can't think of a way your competitors could use the information to your disadvantage.

31 Aug 2010, 2:17 PM
#3
patf avatar

patf

Zen Follower

Join Date:
May 2008
Posts:
200
Plugin Contributions:
0

Re: Change the way order nubmer is generated

Place an order yourself and then at regular intervals update that order number. If you jump it by a 1000 or so whatever level of traffic you want to imply every couple of days you will have the effect of implying a busier site.

31 Aug 2010, 5:07 PM
#4
cindy2010 avatar

cindy2010

Zen Follower

Join Date:
Apr 2010
Posts:
100
Plugin Contributions:
0

Re: Change the way order nubmer is generated

stevesh:

You'd have to rewrite the code which assigns those numbers - not exactly a simple job.

Do you know where is the code for that? (order number, and customer number)

31 Aug 2010, 5:33 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Change the way order nubmer is generated

stevesh:

I guess I don't understand why either of those things would be 'really bad'. Most customers don't care how much business you're doing as long as your site looks professional and your prices are good, and I can't think of a way your competitors could use the information to your disadvantage.

Valid points!

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 Aug 2010, 6:16 PM
#6
cindy2010 avatar

cindy2010

Zen Follower

Join Date:
Apr 2010
Posts:
100
Plugin Contributions:
0

Re: Change the way order nubmer is generated

DrByte:

Valid points!

So you think, all major website, Amazon, buy.com, etc., never use simple sequence as customer id or order id, they just did it for fun and for no reason? :blink:

From technical point of view, it is not a good idea that a hacker can easily guess out all the IDs.

Anyway, this is off the topic. Let's focus how to do it. Not why to do it. :P

31 Aug 2010, 6:24 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Change the way order nubmer is generated

The current version of Zen Cart exerts no control over order numbers or customer numbers. It leaves that up to the database to handle via an auto-increment counter. That means when a new record is added, the database automatically picks the next integer number greater than the last one used. That's all handled by MySQL, not Zen Cart.

I guess you're welcome to rewrite how MySQL works when adding +1 to numbers. You'll need a dedicated server to install your own customized C++ code, then compile the new code after you've written the new functionality, and then run your site from that. Of course, then all the other database tables that do other auto-incrementing will grow exponentially large and blow out capacity too.

Assuming you're probably not interested in tackling it that way, we come back to finding a solid reason for thinking it's needed in the first place.
I see no threat with regard to a hacker guessing customer IDs or order IDs. How exactly do you think those can be abused if they can be guessed? I'd be very interested in exactly what threat you think exists.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 Aug 2010, 6:27 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Change the way order nubmer is generated

I'm sure they had good reasons for generating customer and order ids in a different way, but with the volume of business they do, how could sequential numbers hurt them? I suppose a hacker could guess a valid number more easily if that would benefit them... but it would probably not be hard to guess a valid number like the actual ones, for a hacker who actually knows coding.

Not sure about the customer id, but the order id is a primary key in the database, and needs to be sequential, unless you change the way the db works.

Edit: Yeah, what DrByte said... :)

31 Aug 2010, 7:51 PM
#9
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Change the way order nubmer is generated

Cindy2010:

So you think, all major website, Amazon, buy.com, etc., never use simple sequence as customer id or order id, they just did it for fun and for no reason? :blink:

From technical point of view, it is not a good idea that a hacker can easily guess out all the IDs.

Anyway, this is off the topic. Let's focus how to do it. Not why to do it. :P

I can't speak for Amazon, etc., but custom shopping cart software can do a lot of stuff a standard open source cart can't do, and at a much greater expense.

As I mentiioned, you would have to write considerable code to accomplish what you're asking. You might try posting in the Commercial Help wanted forum.

Most importantly, this forum isn't a Knowledge Base where you get pre-written answers depending on keywords in your question. It's a community, and the why is often more important than the how.

I and (apparently) others think your approach doesn't make sense, and we'll be pleased to say so.