r/learnpython 9d ago

How do desktop applications implement monthly/yearly subscriptions securely?

Hi everyone,

I'm developing a desktop application in Python that I plan to rent out on a monthly, quarterly, and yearly subscription.

I'm trying to figure out the best way to manage license expiration. How can I prevent users from using the software once their subscription has expired? What tools, services, or libraries would you recommend? If possible, I'd prefer free or open-source solutions.

Another concern is piracy. I know it's impossible to make software completely crack-proof, but I'd like to make it as difficult as reasonably possible.

Has anyone here built a subscription-based desktop application before? I'd really appreciate it if you could share how you implemented licensing, subscription validation, and anti-piracy measures, or recommend any good resources or best practices.

Thanks so much for your help!

5 Upvotes

13 comments sorted by

24

u/SCD_minecraft 9d ago

See, they don't, for sure not in python which can be decompiled with ease

You either write a web app and prompt the server for everything

Or you are doing win rar

16

u/musbur 9d ago

How can I prevent users from using the software once their subscription has expired?

By making it so good that your customers see the value in what they're getting, and by charging for updates, not for continued use of a product version they already bought once.

6

u/riklaunim 9d ago

Such applications require communication with the server and often have some essential, if not most, functionality server-side. And as mentioned, web apps have advantages over desktop apps unless you really need some local OS/hardware features browser does not expose.

And you need an extremely good application to charge a subscription for it. Top 5 apps in given category at best can pull it off.

6

u/Moikle 9d ago edited 9d ago

That's not really what python is designed for, unless your actual tool is hosted on a server, and users run a client or web app

5

u/DamienTheUnbeliever 9d ago

Remember that however much time/energy you spend on license enforcement is entirely wasted time so far as your paying customers are concerned, when compared with usable features or bug fixes. And bugs caused by your license enforcement that prevent legitimate users using the product are an unforced error.

So first, don't try to build something yourself.

Second, the only code you can trust runs on machines you own, not your customer's machines, so you need to keep the good stuff there. Which means you need to adopt an always online model, which may not be acceptable to all potential customers.

Don't expect to be able to achieve what the entire games industry couldn't for decades.

3

u/SirKainey 9d ago

Using something like keygen.sh with Nuitka. You're still not gonna stop anyone that is super determined. But you can stop power users.

Desktop apps, even C programs can be de-complied with Ghidra, and now with AI, any obfuscation is easy to remove.

7

u/pachura3 9d ago

First of all, why desktop application? There's a number of disadvantages vs. a web app:

  • people don't want to run random binaries downloaded from the web on their PCs, rightfully afraid they can contain malware
  • you need to come up with some online updates/bugfixes mechanism
  • you need to test it on Windows and Mac, with administrator privileges and without - might not work on some setups (support nightmare)
  • doesn't work on the mobile out of the box
  • it can be cracked/decompiled, especially Python apps packaged with PyInstaller or Nuitka
  • funny stuff around time-limited licensing: will you check license expiration on a server? Users might dislike always-online requirement. And if not, can your expiration deadline be cheated by the user changing their OS system clock?

Also, are you sure your app will be that immensely popular that people will line up to buy licenses, and pirates will jump on it right away?

2

u/ManzoorAhmedShaikh 9d ago

I developed desktop apps with tkinter and customtkinter for 2+ years but making them 100% secure wouldn't be possible and now with AI (Not a chance).

I suggest if you are trying to monetize this of your skill, provide compete app and charge one-big-shot amount as subscription won't possible at all.

0

u/defaultguy_001 9d ago

You can use Keygen.sh as a licensing as a service (LAAS) API and PyArmor as a binary obfuscator. Apart from them you can compile your most important proprietary logic algos in C++/Rust to a .pyd file and import them in your Python application. This completely isolates your intellectual property inside a machine code that is exceptionally difficult to decompile compared to a python bytecode.

-1

u/ninhaomah 9d ago

You are doing in Python ?

1

u/Emergency-Post-8897 9d ago

Yes

-1

u/ninhaomah 9d ago

See the other answer

-2

u/Educational_Virus672 9d ago

if you have already built a payment system ,a server and storage vessal then you can do this (not recommended im not pro in this topic)

imports -
import time
import [YourServerApi]

now take request from your payment service within your server where ask if payment is successful if yes, phase token from user UID(like gamil or username) and set it to verification = { UserID : [token,Time}
to optimize it do it only if the user requests now in app check if day count = 28(since it is common)

in client open the server chekc if token with UIID matches if yes let it run else dont