[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Serial Number Needed!

Posted on 2006-04-16
6
Medium Priority
?
476 Views
Last Modified: 2010-04-15
Ah, got your attention.

Yes, I do need one, but for my program.

I would like the serial number to be 3 sets of 2 numbers:

Ex. 12-43-56

I would like each serial to be unique to each machine.

Any small function will do, but something unique and clever. All I come up with was using the computername which has been done a thousand times.

Some rough but working example would be great. I need some ideas to exand on.
0
Comment
Question by:edvinson
6 Comments
 
LVL 14

Expert Comment

by:cwwkie
ID: 16465676
> Ah, got your attention.
lol

> I would like each serial to be unique to each machine.

You mean generate something unique based on the hardware or os running on the pc.
You can use a hash based on the MAC address of a network card. Or use the harddisk volume id.
0
 
LVL 11

Expert Comment

by:WelkinMaze
ID: 16465816
Hi,

A serial number of this type will give you just 1000000 possible combinations.
Furthermore, I don't think these kind of codes are very welcomed by the user - what will happen if the user changes his network card or hard drive.
It's highly dependant on the kinf of program you want to protect what protection to use.
But generally in the most cases the efforts for elaborating of a certain protection do not worth themselves. The hackers out there are too good..
It's better to pick up some simple protection mechanism and to put more of your efforts in creating of features of your software that will make the user to want to pay for it.
0
 
LVL 16

Expert Comment

by:PaulCaswell
ID: 16465936
How about using the installation date/time in some form?

Paul
0
Live webcast with Pinal Dave

Pinal Dave will teach you tricks to help identify the real root cause of database problems rather than red herrings. Attendees will learn scripts that they can use in their environment to immediately figure out their performance Blame Shifters and fix them quickly.

 
LVL 5

Expert Comment

by:cryptosid
ID: 16467318
Have you tried google.com :-)

You could use random number generation functions..

rand() and srand()

http://cplus.about.com/od/cprogrammingtips/l/aa041403a.htm

Regards,
Siddhesh
0
 
LVL 6

Accepted Solution

by:
billtouch earned 1500 total points
ID: 16467562
Random numbers won't be unique to the machine. a 6 digit serial number isn't very many numbers. At the very least, create a long number and only use 6 internally - but don't reveal that secret to the world.

And Paul, HDD volume id can be changed by the user. I think you must be referring to the hard drive serial number. That is unique to the drive and cannot be changed (without getting into the drive electronics).

As for terms... serial numbers are usually assigned by the manufacturer in sequence as product is shipped. It usually isn't connected to a machine or installation. What you are probably looking for is an activation or registration number. There would be a lot of use making these tied to some constant value in your computer. Paul's suggestion of HDD serial number (corrected) or MAC address off your ethernet card are theleast changing values in you computer - using those would serve you well.

Bill
0
 
LVL 22

Expert Comment

by:grg99
ID: 16468562
Many many network cards let you change the MAC address from the control panel.

There is no good way of getting a deterministic and unchangeable.

0

Featured Post

Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question