Generating license keys for my python app
Asked Answered
M

4

6

this is my first time ever making full python app with tkinter and wanting to distribute it. I've been searching the net, but I cant quite figure out how to make a license key for my application, as in I want a unique key I give to certain people which allows them to run the application, and also I want to able to deactivate that key and make new ones. Note this is an application for window computers, Thanks for any help in advance.

Maniac answered 23/7, 2020 at 17:43 Comment(4)
If you want to desactivate remotely, it seems you need a central server that allows the app to run by checking its key everytime it's launched. What is your question ? What have you tried ?Degraw
Generating a key is a piece of cake. Protecting your app especially for an interpreted language is going to be the hard part.Viridian
Yeah I just wanna know how to generate the keys and authenticate it, I have zeroooo clue, I don’t know where to startManiac
Yeah it seems i need a Server to check it’s key every time it’s launchedManiac
O
4

Check out keygen.sh - It's LaaS (Licensing as a service).

You create an account and generate license keys with or without an expiration date and number of unique devices. From your app, you then use their API to validate/activate your license.

There's an example showing device activation, license validation and deactivation.

Ophidian answered 15/8, 2021 at 6:55 Comment(0)
I
3

I hope this helps :)

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()
Infeudation answered 21/5, 2022 at 18:0 Comment(2)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Untwist
This is literally exposing all the valid license keys on the public Internet.Calkins
R
0

you can generate using python uuid after that need to store in database from there you can authanticate, remove or add new keys.

Reaves answered 23/7, 2020 at 18:5 Comment(5)
Is there a tutorial on this somewhere ?Maniac
I don't know about that but you can make script as I said and If you want gui for this than make django admin panel.Reaves
also one thig you can also implement it like session/coockie so after every X time it'll expire.Reaves
ohk than you can use tkinter but that looks like outdated thing :) also if you use django than as I think your development will be 20X faster and also looks good.Reaves
Isn’t django used for web application? Mine is desktop applicationManiac
S
0

If you want to convert it to exe then ship it with an installer, InstallForge app can generate serial codes for you. At the left panel of InstallForge, there is a Dialog section containing 'Serial Validation.' You can generate random serial codes with it and store it in your activation server.

Spermatophore answered 30/1, 2023 at 8:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.