How to secure Python application using license key?
-
I want to secure my python app using an online license key. Consider the following simple example:
import requests
def license():
# The list with all keys.
keys = requests.get("http://yourlink.com/licensekeys.txt").text
# keys = ["key1", "key2", "key3"]# License key from user. keyfromuser = "mykey" for key in keys.splitlines(): if key == keyfromuser: # Code when key match. return # Code if the key don't match. exit()
license()
Anybody can open my code in notepad and make some changes to disable the license key requirement. What is the best strategy to implement license approach to make it harder to beginner and intermediate level programmers to reverse engineer my app?
-
I want to secure my python app using an online license key. Consider the following simple example:
import requests
def license():
# The list with all keys.
keys = requests.get("http://yourlink.com/licensekeys.txt").text
# keys = ["key1", "key2", "key3"]# License key from user. keyfromuser = "mykey" for key in keys.splitlines(): if key == keyfromuser: # Code when key match. return # Code if the key don't match. exit()
license()
Anybody can open my code in notepad and make some changes to disable the license key requirement. What is the best strategy to implement license approach to make it harder to beginner and intermediate level programmers to reverse engineer my app?
You put the functionality in a web service. No service without a valid key.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I