I want to packed my program use RSA algorithm. Of course, $MachineID
can be used but I want to make it safer. Can Mathematica obtain the computer's hard drive serial number, BIOS ID, CPU number, MAC and so on? Or any other Machine Key? The command SystemInformation[]
seems not include the other Machine Key.
2 Answers
According to Oleksandr R. wmic can only be run by Administrators. Here is how you get the Serial on Windows.
Import["!wmic bios get serialnumber", "Text"]
To get CPU information
Import["!wmic cpu get NumberOfCores, NumberOfLogicalProcessors/Format:List", "Text"]
To get the MAC Address run.
StringSplit[
StringReplace[
StringCases[Import["!ipconfig /all", "Text"],
"Physical Address. . . . . . . . . :" ~~ x___],
"Physical Address. . . . . . . . . : " -> ""], "\n"][[1, 1]]
And to get BIOS ID.
Import["!wmic bios get name,serialnumber,version", "Text"]
-
$\begingroup$ I upvoted, but it should be mentioned that
wmic
can only be run by administrators. This is likely to be a problem in general, although I can't see any way around it. $\endgroup$ Sep 16, 2015 at 2:28 -
$\begingroup$ Also, you only get the first MAC address from
ipconfig
, and it is not guaranteed that all media types have the same length of physical address. For instance on my computer I have 4, 6, and 8-byte physical addresses. $\endgroup$ Sep 16, 2015 at 2:35 -
$\begingroup$ @OleksandrR. I admit I was concerned my mac address approach wasn't very practical. $\endgroup$– WilliamSep 16, 2015 at 2:36
-
1$\begingroup$ Instead of
ipconfig /all
you could also usegetmac
which is more compact. $\endgroup$ Jan 24, 2016 at 15:14
The only thing I could find very easily is the HWaddr of the network device that can be obtained by
SystemInformation["Network", "IPAddresses"]
-
1
wmic
, then simplywmic nic get MacAddress
should list all the MAC addresses. $\endgroup$