Trying to access a custom system key/code

D

DanielGifford

Hi

I'm making some basic cryptography software and I've run into a snag.

I'm trying to retrieve some sort of system number thats specific to
the system I'm working on.

It can't change over time.

Whether its a cpu id, memory id, system serial key, or anything else
is irrelevant.

Does anyone know how to access such a number through managed code?

Or even unmanaged code?

Managed code is strongly preferred.

thanks

-Dan
 
N

Nicholas Paldino [.NET/C# MVP]

Dan,

There really isn't anything definitive like this that you can apply to
all systems. There are some systems which come with ids for processor
cores, but that's not ubiquitous. It's also feasible to swap out memory
with new memory chips (so a memory id is out)...

Check out the recent discussion on serial numbers which is related to
the topic.

http://groups.google.com/group/micr...6f6f820a063/a3c357629a9e9d4d#a3c357629a9e9d4d

At best, you are going to have to develop a heuristic to determine what
is "unique" for your scenario. Either that, or you are going to have to
create a strict rule as to aspect of a system make it unique (from your
code's point of view) and what happens if those things change.

I would recommend taking a look at the classes in the System.Management
namespace to perform WMI queries for the information you are looking for.
For processors, you can use the Win32_Processor WMI class (for which you can
probably use the UniqueId property), for actual details about physical
memory, take a look at the Win32_PhysicalMemory WMI class (for which you
might be able to use the SerialNumber property).
 
D

DanielGifford

Dan,

There really isn't anything definitive like this that you can apply to
all systems. There are some systems which come with ids for processor
cores, but that's not ubiquitous. It's also feasible to swap out memory
with new memory chips (so a memory id is out)...

Check out the recent discussion on serial numbers which is related to
the topic.

http://groups.google.com/group/microsoft.public.dotnet.languages.csha...

At best, you are going to have to develop a heuristic to determine what
is "unique" for your scenario. Either that, or you are going to have to
create a strict rule as to aspect of a system make it unique (from your
code's point of view) and what happens if those things change.

I would recommend taking a look at the classes in the System.Management
namespace to perform WMI queries for the information you are looking for.
For processors, you can use the Win32_Processor WMI class (for which you can
probably use the UniqueId property), for actual details about physical
memory, take a look at the Win32_PhysicalMemory WMI class (for which you
might be able to use the SerialNumber property).

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


I'm making some basic cryptography software and I've run into a snag.
I'm trying to retrieve some sort of system number thats specific to
the system I'm working on.
It can't change over time.
Whether its a cpu id, memory id, system serial key, or anything else
is irrelevant.
Does anyone know how to access such a number through managed code?
Or even unmanaged code?
Managed code is strongly preferred.

-Dan

Hmmm... well this software is only going to be installed on PDAs.
swapping the memory on that is impossible. Any ideas?
 
N

Nicholas Paldino [.NET/C# MVP]

Daniel,

I don't know much about developing for PDAs, but I imagine that you
could use a processor id, in conjunction with memory ids to create some sort
of unique identifier, because it seems highly unlikely that either of these
things is going to be swapped out.

You might also consider a subscriber id as well (if you want to key it
to the user).

The classes in the System.Management namespace aren't available in the
Compact framework, so you are still going to have to find a way to get that
information. More than likely, you will have to access it through the
P/Invoke layer, calling API functions exposed by the system.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Dan,

There really isn't anything definitive like this that you can apply
to
all systems. There are some systems which come with ids for processor
cores, but that's not ubiquitous. It's also feasible to swap out memory
with new memory chips (so a memory id is out)...

Check out the recent discussion on serial numbers which is related to
the topic.

http://groups.google.com/group/microsoft.public.dotnet.languages.csha...

At best, you are going to have to develop a heuristic to determine
what
is "unique" for your scenario. Either that, or you are going to have to
create a strict rule as to aspect of a system make it unique (from your
code's point of view) and what happens if those things change.

I would recommend taking a look at the classes in the
System.Management
namespace to perform WMI queries for the information you are looking for.
For processors, you can use the Win32_Processor WMI class (for which you
can
probably use the UniqueId property), for actual details about physical
memory, take a look at the Win32_PhysicalMemory WMI class (for which you
might be able to use the SerialNumber property).

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


I'm making some basic cryptography software and I've run into a snag.
I'm trying to retrieve some sort of system number thats specific to
the system I'm working on.
It can't change over time.
Whether its a cpu id, memory id, system serial key, or anything else
is irrelevant.
Does anyone know how to access such a number through managed code?
Or even unmanaged code?
Managed code is strongly preferred.

-Dan

Hmmm... well this software is only going to be installed on PDAs.
swapping the memory on that is impossible. Any ideas?
 
D

DanielGifford

Daniel,

I don't know much about developing for PDAs, but I imagine that you
could use a processor id, in conjunction with memory ids to create some sort
of unique identifier, because it seems highly unlikely that either of these
things is going to be swapped out.

You might also consider a subscriber id as well (if you want to key it
to the user).

The classes in the System.Management namespace aren't available in the
Compact framework, so you are still going to have to find a way to get that
information. More than likely, you will have to access it through the
P/Invoke layer, calling API functions exposed by the system.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Dan,
There really isn't anything definitive like this that you can apply
to
all systems. There are some systems which come with ids for processor
cores, but that's not ubiquitous. It's also feasible to swap out memory
with new memory chips (so a memory id is out)...
Check out the recent discussion on serial numbers which is related to
the topic.
http://groups.google.com/group/microsoft.public.dotnet.languages.csha...
At best, you are going to have to develop a heuristic to determine
what
is "unique" for your scenario. Either that, or you are going to have to
create a strict rule as to aspect of a system make it unique (from your
code's point of view) and what happens if those things change.
I would recommend taking a look at the classes in the
System.Management
namespace to perform WMI queries for the information you are looking for.
For processors, you can use the Win32_Processor WMI class (for which you
can
probably use the UniqueId property), for actual details about physical
memory, take a look at the Win32_PhysicalMemory WMI class (for which you
might be able to use the SerialNumber property).
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi
I'm making some basic cryptography software and I've run into a snag.
I'm trying to retrieve some sort of system number thats specific to
the system I'm working on.
It can't change over time.
Whether its a cpu id, memory id, system serial key, or anything else
is irrelevant.
Does anyone know how to access such a number through managed code?
Or even unmanaged code?
Managed code is strongly preferred.
thanks
-Dan
Hmmm... well this software is only going to be installed on PDAs.
swapping the memory on that is impossible. Any ideas?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top