Jump to content
Sign in to follow this  
Adrive

Unique computer key

Recommended Posts

Adrive

Hello

how can we get a number/key of a computer which can never be matched with another one?

i was using something like this:

$Pc_Info = @ComputerName & @UserName & @CPUArch & @IPAddress1 & @OSType & @OSArch & @OSLang & @OSBuild & @OSVersion
$Key = StringSplit(StringUpper(StringRegExpReplace($Pc_Info, "(?i)[^a-z0-9]+", "")), "")

but it always gets changed when a new operating system is installed.

any ideas?

Share this post


Link to post
Share on other sites
Spiff59

Using the word "never" is where you get into trouble.

A lot of software vendors have gone the hardware-key route.

But stick in a bigger hard drive, more memory, or a faster CPU and you'll likely be calling them to reactivate.

Share this post


Link to post
Share on other sites
Richard Robertson

The only way to match to a single computer is to have some piece of hardware that cannot be removed from the computer. Considering the number of virtual machines in use, this becomes impossible.

Share this post


Link to post
Share on other sites
BrewManNH

Hello

how can we get a number/key of a computer which can never be matched with another one?

i was using something like this:

$Pc_Info = @ComputerName & @UserName & @CPUArch & @IPAddress1 & @OSType & @OSArch & @OSLang & @OSBuild & @OSVersion
$Key = StringSplit(StringUpper(StringRegExpReplace($Pc_Info, "(?i)[^a-z0-9]+", "")), "")

but it always gets changed when a new operating system is installed.

any ideas?

Do the computers have serial numbers in BIOS, like Dells/HPs etc.? Use the serial number and then it will only get changed if you have to replace the motherboard and you don't have the option to reset it back. Other than a hardware check there isn't anything that won't ever change by something like an OS install and even with a hardware check, it's going to change if you ever change the hardware. In the computer world, there's nothing permanent. If you keep the computer names from OS version to new OS version, then you have that as something to track, user names/IP Addresses are as changeable as your underwear.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
jchd

@Adrive,

The problem is that your question is fundamentally ill-posed. If you expect a reasonable answer, then you first have to define "computer". That's where the problem begins.

Let's assume that a "computer" consists of a chassis, a power supply, a motherboard, a CPU, memory, HDD, DVD, display, peripherals.

Is that the same computer if I change any element in it against another compatible element?

What does the "computer" become if I decide to disassemble it and place everyone of its elements into other "computers"?

Even if you assume that you can uniquely identify every element with a unique number, which is currently essentially impossible using stock components, the answer to the above questions is the real issue.

Now if the software used to check any unique ID is available for an open machine, it will become the weakest link, so you need to protect against that threat as well which is much harder than solving the --already hard-- hardware issue.

That raises the question of tamper-resistance, to barr cheating. You quickly end up with unpractical, utterly expensive and proprietary solutions, which are likely to be broken anytime soon if it is worth it.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
spudw2k

I'd say a fairly simple way would be to capture the Motherboard Serial, CPU ID, and perhaps and/all MAC addresses on a machine.

Share this post


Link to post
Share on other sites
Dana

Many copy protection schemes use the MAC address of the network adapter. Sure, you could move the network card into another computer if it's not part of the motherboard, but is it really an issue? Either way, there's only going to be one network card with that MAC address out of a pool of some 281 trillion possibilities. Sometimes it uses the serial number of the first hard drive in the [extremely unlikely, these days] event that a network adapter isn't found.

Share this post


Link to post
Share on other sites
jchd

Most network adapters offer the option to change the MAC address to whatever you want.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
seandisanti

Most network adapters offer the option to change the MAC address to whatever you want.

and if they don't, madmacs does. i have my mac id's changed at every reboot

Share this post


Link to post
Share on other sites
seandisanti

I have used "smac" to change mine on the occaision, its just a couple of clicks.

madmacs is a quick and free, and originally made with autoit if i remember correctly. all it really does is a quick registry edit, but it lets you reset for any or all of your mac id's also which is nice when you're running wireless, lan, etc

Share this post


Link to post
Share on other sites
spudw2k

Share this post


Link to post
Share on other sites
seandisanti

paranoid much? sounds like a network security admin's nightmare.

i've been called that before, and paranoid ;)

Share this post


Link to post
Share on other sites
Dana

The various means of changing the MAC address don't actually change the MAC address which is burned into the card, only what gets reported to Windows networking. I don't know if a program like a copy protection scheme which relies on hardware would be able to read the true hardware MAC... if it couldn't it would seem to be a pretty big security hole for such programs.

-Dana

Share this post


Link to post
Share on other sites
Yashied
anixon

Hello

how can we get a number/key of a computer which can never be matched with another one?

i was using something like this:

$Pc_Info = @ComputerName & @UserName & @CPUArch & @IPAddress1 & @OSType & @OSArch & @OSLang & @OSBuild & @OSVersion
$Key = StringSplit(StringUpper(StringRegExpReplace($Pc_Info, "(?i)[^a-z0-9]+", "")), "")

but it always gets changed when a new operating system is installed.

any ideas?

I use the following code to create an encryption key

;// Set Default Encryption Key [Machine Specific]
Const $WinDirID = "HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\"
Global $uKeyR = RegRead($WinDirID, "InstallDate") ;//User Data Key Extracted from Windows Installation Date
;//Set to Default Key if Installation Date/Time less than 5 Digits
If StringLen($uKeyR) < 5 Then $uKeyR = 1196279887
;//Compile a Unique Encryption Key using Windows Install Date Converted to Num+Asc+Asc+Num]
Global $uKey = StringLeft($uKeyR, 1) & Chr(62 + StringLeft($uKeyR, 1) + StringMid($uKeyR, 2, 1) + StringMid($uKeyR, 3, 1)) & _
  Chr(94 + StringMid($uKeyR, 4, 1) + StringMid($uKeyR, 5, 1) + StringMid($uKeyR, 6, 1)) & StringRight($uKeyR, 1)

I then use the unique key created from the windows install date/time to decrypt a variable stored in an INI file if it does not

match the internal const variable then it fails the test which means that the Destop is not the same.

Edited by anixon

Share this post


Link to post
Share on other sites
Richard Robertson

But it would be easy to trick it.

Share this post


Link to post
Share on other sites
spudw2k
LoWang

That's what we use in our company

Func getpcserialnumber()
; Generated by AutoIt Scriptomatic
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$Output=""
$Output = $Output & "Computer: " & $strComputer  & @CRLF
$Output = $Output & "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
if $objWMIService=0 then
 ;lognio("ERROR: WMI corrupted on workstation, cannot get the information.")
 return -1
endif

$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _
                                           $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
    For $objItem In $colItems
        $serialnumber = $objItem.SerialNumber
    Next
Else
    $serialnumber=-1
Endif
return $serialnumber
endfunc
Edited by LoWang

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.