I will do more research on other ways to protect programs, thanks for the info.
Well, after a few eye-straining hours sifting through online tutorials
I think I'm on the way to create my first simple, license enforcement
code. Well a small part of it anyway. Here is what I have so far that will need more modifications.
This code basically gets the processorID and motherboard DeviceID then generates a two-way hash.
System Specs:
Windows XP SP2
Python 2.4
wxPython 2.6.2.1 (unicode)
boa-constructor 0.4.4
win32 extensions
import win32com.client, string, random, zlib, base64
strComputer = "."
objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator")
objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2")
colItems = objSWbemServices.ExecQuery("Select * from Win32_Processor")
for objItem in colItems:
procId = objItem.ProcessorId
colItems = objSWbemServices.ExecQuery("Select * from
Win32_MotherboardDevice")
for objItem in colItems:
moboId = objItem.DeviceID
IDs = "".join([procId, moboId])
def Gen(key, text, reverse=False):
rand = random.Random(key).randrange
if not reverse:
text = zlib.compress(text)
text = ''.join([chr(ord(elem)^rand(256)) for elem in text])
if reverse:
text = zlib.decompress(text)
return text
if __name__ == "__main__":
def strToHex(aString):
hexlist = ["%02X " % ord(x) for x in aString]
return ''.join(hexlist)
keyString = "Some special key"
idString = IDs
print "String:", idString
idString = Gen(keyString, idString)
hexString = strToHex(idString)
b64String = base64.encodestring(hexString)
print "Encrypted string:", b64String
idString = Gen(keyString, idString, reverse=True)
print "Decrypted string:", idString
ยทยทยท
----- Original Message ----- From: "the_shelter" <pdftex@the-shelter.de>
To: "Tim Roberts" <wxPython-users@lists.wxwidgets.org>
Sent: Wednesday, March 15, 2006 3:11 AM
Subject: Re: [wxPython-users] Re: How to get system serial numbers then MD5 it
> Motherboards do not have serial numbers. Intel processors since the
> Pentium-III do, but they are turned off by default because of the hue
> and cry over potential privacy violations.> Are you trying to do some kind of license enforcement? You'll have to
> find another way.Developers tried to tie their software to hardware for licensing
issues ever since ...
A popular way was/ is the mac adress of a network interface- though
the hardware adress can easily be spoofed. However, legally it is not
allowed to tie software to
hardware that you do not deliver along w/ your application. There have
been several court decisions in various countries.
There are of course exceptions- but even microsoft decided to tie
their WinXP on the overall hardware configuration, not for instance on
the CPU ...
Anyway, just some background info in case ... I admit to sometimes
also tie little apps to some hardware if I do not want an app to
spread i.e. witthin a company ...--
Best regards,
the_shelter mailto:pdftex@the-shelter.de---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org