Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

faffoo

macrumors 6502
Original poster
May 22, 2008
293
46
Glasgow, UK
I am looking for a way to have a UNIQUE identifier for every mac i run my program on. How can i do this?

Ive found dozens of links to a technote on apples site that doesnt exist any more. So all help is appreciated.

The MAC address is no good for me.

Regards
Matt
 
I have read about using this, but I have also read that if certain components are changed in a Mac the serial number turns to a string of 0's? Is this true? and if so this is no good.

It's not exactly true.

What the serial number is changed to is unpredictable. It's not guaranteed to be a string of 0's. It's not guaranteed to even be in the form of a serial number.

I had a machine repaired under warranty, which replaced the main logic board. It came back with a serial number of the literal string "SystemSerialNumb".

There's nothing that perfectly meets your criteria. Any replacement of the main logic board can change both the MAC and the serial-number. So you should probably explain what you're trying to accomplish with this unique number, including how unique it must be, how persistent it must be (survive main logic board replaced?), why the MAC is unacceptable, etc. If you're trying to implement a license scheme, then say that.
 
It's not exactly true.

What the serial number is changed to is unpredictable. It's not guaranteed to be a string of 0's. It's not guaranteed to even be in the form of a serial number.

I had a machine repaired under warranty, which replaced the main logic board. It came back with a serial number of the literal string "SystemSerialNumb".

There's nothing that perfectly meets your criteria. Any replacement of the main logic board can change both the MAC and the serial-number. So you should probably explain what you're trying to accomplish with this unique number, including how unique it must be, how persistent it must be (survive main logic board replaced?), why the MAC is unacceptable, etc. If you're trying to implement a license scheme, then say that.

Basically, i need a unique identifier to complete a licensing system. I need it to be as persistant as possible without having to store it both on my web server and the client machine.

I have read the MAC address can be changed, so id rather avoid that.

And the thing I initially thought of was the Hardware UUID? is that any good? and if so how can i get that?

Regards
Matt
 
Basically, i need a unique identifier to complete a licensing system. I need it to be as persistant as possible without having to store it both on my web server and the client machine.
Pay for a dongle?

Who are you trying to defend against? What attackers? What attacks? What is it worth to you for this defense (put an actual dollars/unit figure on it)? If you don't know who you're defending against, or what you're willing to pay to limit it, then you don't know enough to decide on a suitable strategy.

And even paying for a dongle won't make you immune. Everything can be defeated, given time and inclination. There are people who break licensing schemes for fun. So you also need a response plan and mitigation strategy when your finely honed defense eventually falls to attackers.

The subject of license registration schemes comes up repeatedly, so this discussion has happened before (and will happen again). Search the MacRumors archives. Example:
https://forums.macrumors.com/threads/852084/


I have read the MAC address can be changed, so id rather avoid that.

And the thing I initially thought of was the Hardware UUID? is that any good? and if so how can i get that?
Enter these command lines in Terminal, and look at the output:
Code:
system_profiler | grep UUID

ifconfig | grep ether
On my machines, there's a remarkable similarity between the so-called Hardware UUID and the primary (en0) MAC.
 
Basically, i need a unique identifier to complete a licensing system. I need it to be as persistant as possible without having to store it both on my web server and the client machine.

A licensing system must (1) not interfere with licensed use of the software and (2) make sure the licensor does not inadvertently exceed the license. That's what you need to do. To protect against circumvention of the licensing system you use lawyers. With that in mind, using the MAC is fine.
 
On my machines, there's a remarkable similarity between the so-called Hardware UUID and the primary (en0) MAC.

Interesting. Not so on my MBP 5,3 at least.

Code:
Hadrware UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
MAC: XX:XX:XX:XX:XX:XX (en0, en1) or
MAC: XX:XX:XX:XX:XX:XX:XX:XX (fw0)

And none of the sequential bytes in the MACs are also in the UUID.

I agree with gnasher729, unless you go to a dongle the MAC or HW UUID should do.

B
 
Interesting. Not so on my MBP 5,3 at least.

Code:
Hadrware UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
MAC: XX:XX:XX:XX:XX:XX (en0, en1) or
MAC: XX:XX:XX:XX:XX:XX:XX:XX (fw0)

And none of the sequential bytes in the MACs are also in the UUID.

I agree with gnasher729, unless you go to a dongle the MAC or HW UUID should do.

B

OK. I think the best approach would be to get the serial number, MAC address, and UUID and combine them all.

Does anyone know how i can get an NSString of the MAC address? And the UUID if possible? I have the serial number now.

Regards
matt
 
If you don't want to make use of C libraries you could cheat and use NSTask or NSPipe and stick the output of "ifconfig eth0" into an NSString that way.

;)

B
 
See this thread:
https://forums.macrumors.com/threads/689645/

Found with google search terms:
get MAC address programming site:forums.macrumors.com

get MAC address - because that's the info wanted.
programming - to search only programming forums.
site:forums.macrumors.com - for site-specific search.

And you should learn enough C to know what function calls and type declarations look like. Otherwise you're at a serious disadvantage when it comes to even simple stuff like printf().


On the general subject of license schemes, try search terms such as:
programming license site:forums.macrumors.com
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.