Python Forum
Make my py script work only on 1 compter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make my py script work only on 1 compter
#1
I want my py program to work only on one specific computer.
My aim is to get a unique ID of any computer of any OS once my program is first lauch on that computer, then i will save the ID into a database for later confirmation if the program is runing on the same computer or not.

I used this;
import uuid
Computer_id = uuid.getnode()
print(Computer_id)
I dont really know how this getnode() method works, I saw it on stackover answer. But the problem is that it keep returning different id number on a period of time which is not what I want!

Please how can I get any unque id of a computer like motherboard ID, serial number or any unique id using python?
Reply
#2
Explaining why you want to do that in the first place would be a good start.
buran likes this post
Reply
#3
(Feb-17-2022, 01:09 PM)ndc85430 Wrote: Explaining why you want to do that in the first place would be a good start.

I want to put a license on the program so that users can get a license that work on 1,2,3... computers base on their need
Reply
#4
I think you are on the right path, but some kinks. What version of Python?
UUID.getnode() gets the MAC address of the computer, which should be unique. However, computers may have more than one interface, and therefore more than one MAC address (wired vs wifi connections, for example).

I suggest reading the documentation on uuid at https://docs.python.org/3/library/uuid.html
tomtom likes this post
Reply
#5
(Feb-17-2022, 01:46 PM)jefsummers Wrote: I think you are on the right path, but some kinks. What version of Python?
UUID.getnode() gets the MAC address of the computer, which should be unique. However, computers may have more than one interface, and therefore more than one MAC address (wired vs wifi connections, for example).

I suggest reading the documentation on uuid at https://docs.python.org/3/library/uuid.html
Okay, Thank you i will read
python 3.8.3 is my python version
But since it is for mac adress does it work on other OS as well?
Reply
#6
IMHO, if user is determined enough and your program worths the efforts (given the price you want per license) they will always find a way to hack your defence. Consider offering it as SAAS if feasible. Otherwise the license/legal protection is the best approach to protect your work if it's worth the legal troubles. Also, try to find other ways to monetise your app - e.g. offering extra services that represent added value.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#7
(Feb-17-2022, 02:38 PM)buran Wrote: IMHO, if user is determined enough and your program worths the efforts (given the price you want per license) they will always find a way to hack your defence. Consider offering it as SAAS if feasible. Otherwise the license/legal protection is the best approach to protect your work if it's worth the legal troubles. Also, try to find other ways to monetise your app - e.g. offering extra services that represent added value.

i'm going to compile the script, example to .exe
Also it does'nt matter if crack, I just still want to add the lincense
Reply
#8
(Feb-17-2022, 10:07 PM)tomtom Wrote: i'm going to compile the script, example to .exe

Imagine your code is running in a virtual machine. It doesn't let programs running know anything about the physical host it's on, just the virtual host. It can pretend to have any particular hardware attached. The information about motherboard or attached peripherals can be duplicated or made up. Unless you're doing something with cryptographic secrets (like a dongle), the VM or the OS can lie about anything you ask.

Most VM software can generate a unique ID for admins that are cooperating to keep them separate. But if the owner wants to duplicate them and make the hosts indistinguishable, that can be done.
Reply
#9
(Feb-17-2022, 10:07 PM)tomtom Wrote: i'm going to compile the script, example to .exe
https://reverseengineering.stackexchange.com/q/160
Just an example. This is really not an obstacle.

(Feb-17-2022, 10:07 PM)tomtom Wrote: I just still want to add the lincense
Actually, that is what I said - add license and then legal steps to enforce the license if worth it. Always include license.


Anyway, have a look a pyarmor if you are determined to do what you say.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#10
The other question is: is it really worth it? What's the risk if you don't prevent people doing that?
buran likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Make entire script run again every 45 mo NDillard 0 320 Jan-23-2024, 09:40 PM
Last Post: NDillard
  hi need help to make this code work correctly atulkul1985 5 783 Nov-20-2023, 04:38 PM
Last Post: deanhystad
  Trying to make a board with turtle, nothing happens when running script Quascia 3 672 Nov-01-2023, 03:11 PM
Last Post: deanhystad
  newbie question - can't make code work tronic72 2 689 Oct-22-2023, 09:08 PM
Last Post: tronic72
  Why do I have to repeat items in list slices in order to make this work? Pythonica 7 1,330 May-22-2023, 10:39 PM
Last Post: ICanIBB
  Make console show after script was built with Pyinstaller --NOCONSOLE? H84Gabor 0 1,211 May-05-2022, 12:32 PM
Last Post: H84Gabor
  readline.parse_and_bind() does not work in start-up script of Python interpreter zzzhhh 0 1,523 Jan-18-2022, 11:05 AM
Last Post: zzzhhh
  Script stop work after 3 actioins - PLEASE WHERE IS THE PROBLEM? rondon442 0 1,563 Sep-27-2021, 05:40 PM
Last Post: rondon442
  string function doesn't work in script ClockPillow 3 2,416 Jul-13-2021, 02:47 PM
Last Post: deanhystad
  Curses script doesn't work wavic 1 4,150 Jan-08-2021, 09:11 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020