Click here to Skip to main content
15,898,947 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to create a signature using combination of ipv4 address,mac address,PC-Name,UserName

this signature will be unique for every pc offcourse

is there any way i can do that in c++ cli?


What I have tried:

i can get ipv4 address mac address username pc name
but can't think of any way to generate a unique signature from all this info that can uniquely identify a pc
Posted
Updated 30-Jan-20 4:19am

i need to create a signature using combination of ipv4 address, mac address, PC-Name, UserName
this signature will be unique for every pc offcourse
is there any way i can do that in c++ cli?

Several flaws in the thought process:
1. IP Address is only unique within a local network segment or subnet.
2. MAC address may only be unique up to a router, and can be changed or spoofed.
3. PC-Name can be changed
4. UserName can only identify a user, and not the machine in use.

i can get ipv4 address mac address username pc name
but can't think of any way to generate a unique signature from all this info that can uniquely identify a pc
If you are satisfied that your flawed premises from above are accepatble, you could create your signature by using a Hash function such as the Message Digest suite (MD2, MD4, MD5) or a Secure Hash Algorithm (SHA1, SHA2)
 
Share this answer
 
Comments
Richard Deeming 30-Jan-20 11:29am    
Also, 1a) the IP address can and will change. :)

(Technically, public IP addresses can be fixed if you pay extra. Internal IP addresses can be fixed if you're not using DHCP, or you've configured it to issue a fixed address.)
Member 12899279 30-Jan-20 23:21pm    
i think you should mention the laterntive if you think all of the above things cn't be unique and easily spoofed and altred then give the solution
i have said i want to make a signature including all the above things which somehow ill be unique thats why i didnt say just ip4 or mac or pc name i said i'll be using all of this
i was unable to find cpu_id of the pc with c++ code otherwise that would have been included too
The user name is hardly part of a pc identification, and the pc name is just that: a name - it does not have any guaranteed properties that help you identify a specific PC.

As for the IPv4 address, it may not be unique if it's in a local network, compared to addresses of PCs in other local networks. Moreover, since we've run out of globally unique IPv4 addresses, you can't use them reliably anyway.

The only thing you can use here is the mac address. Although it can be tampered with, it's guaranteed to be globally unique. Therefore you need to convert your mac address to IPV6. I'm sure you can find info on that in various places, e. g. here: Convert from MAC to IPv6 - Stack Overflow[^]

The IPV6 address will be globally unique, provided the mac address is genuine.
 
Share this answer
 
Comments
phil.o 30-Jan-20 9:56am    
A mac address can now easily be spoofed, so its uniqueness is greatly compromised. The only thing that can eventually be said is that a mac address can be granted unique only on its network segment (if it isn't, router will start to complain).
Stefan_Lang 30-Jan-20 10:48am    
That's why I said 'provided the mac address is genuine'.

If there is a better way to identify a specific PC; I'm not aware of it.
MadMyche 30-Jan-20 12:45pm    
Nothing really server side; but client side has methods, such as the ones used for Windows Product Activation
Stefan_Lang 31-Jan-20 2:42am    
There are plenty of (illegal) sites offering Windows 10 product keys. There is no 100% safe method.
Member 12899279 30-Jan-20 23:43pm    
so if i add uuid along with mac address still it doesnt make it unique?if yes then kindly tell the solution also instead of just telling that all the mentioned things aren't unique and cant be used collectively to identify a pc uniquely

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900