9
$\begingroup$

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.

$\endgroup$
4
  • 1
    $\begingroup$ What OS are you on? Cross OS I'm quiet certain there is no way. $\endgroup$
    – William
    Sep 15, 2015 at 22:21
  • $\begingroup$ All of my user's OS is Windows Thank you very much! $\endgroup$
    – zzy
    Sep 16, 2015 at 1:34
  • 1
    $\begingroup$ The Mac address was a little tricky $\endgroup$
    – William
    Sep 16, 2015 at 1:44
  • 1
    $\begingroup$ If already using wmic, then simply wmic nic get MacAddress should list all the MAC addresses. $\endgroup$
    – ilian
    Sep 16, 2015 at 14:35

2 Answers 2

10
$\begingroup$

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"]
$\endgroup$
4
  • $\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$
    – William
    Sep 16, 2015 at 2:36
  • 1
    $\begingroup$ Instead of ipconfig /all you could also use getmac which is more compact. $\endgroup$
    – Mark Messa
    Jan 24, 2016 at 15:14
6
$\begingroup$

The only thing I could find very easily is the HWaddr of the network device that can be obtained by

SystemInformation["Network", "IPAddresses"]
$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.