Question

I'm using C# and .NET 2.0. My app needs some way to check the different users so I'll use hardware id, but I saw that I can use only:

  • mac address - easily changeable and not everybody have it // NO
  • processor id - using WMI it returns a value for the cpu model, it's not unique // NO
  • motherboard serial - not every motherboard have it // NO
  • the Windows's volume serial - I'm not sure if it will be changed on Windows reinstall and format of the volume

So is there something I didn't mention for hwid? I want something that everybody have and it won't be erased on windows reinstall. Else I'd have to use the windows's volume serial number.


EDIT: From the commments I think it's best to use HDD id. How to get it? EDIT2: I just read that the SCSI drives don't have serial. Is that true?

FINAL EDIT: I'm already using the root drive serial on my app. It work's pretty well. Thanks all.

Was it helpful?

Solution

HDD Serial number: unique, unchangeable, and everyone has it.

not a perfect option but...

OTHER TIPS

Well i'd go for more than one id. If you combine enough IDs they will get you enough uniqueness.

EDIT: you might also go for the place on the harddisk your program was installed too (Platter, Cylinder etc.)

Why do you want to use hardware Id? I'd go with some kind of forms-based (or AD based) security, myself.

Given that, however: The thing about HWID is that it identifies that particular computer configuration: it is designed to change if there are system changes. You mention that Windows Volume Serial could change on reinstall and reformat, but won't your software also have to be reinstalled at that point? HDD Serial could also change if, say, the user swaps HDDs for some reason.

If you have to use HWID, you'll probably need to select one (or more) of the available options to provide uniqueness and either code around, or inform users about, hardware changes requiring a re-install and/or reconfigure of your software.

The MAC address is not very reliable. You should use something that cannot be changed such a CPU ID or HDD IDE ID.

Here is want I mean:
http://www.soft.tahionic.com/download-hdd_id/index.html
http://www.soft.tahionic.com/download-hdd_id/hardware%20ID%20programmer%27s%20DLL.html


And to answer your question, Yes, SCSI does not have a hardware ID.

Do you have to think about security or only reliability, i.e. does the user want to tamper your ID check? If you need (high) security, buy one of the "software protection" products, this is far cheaper than to do it yourself.

No high security required? => Another possibility is to use the User or Machine SID. You have to take into account that your application is executed elvated => User is Administrator then.

Last but not least: Write a random value of some bytes into the registry (possibly at various places) under HKEY_CURRENT_USER and use these as an ID.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top