Ask HN: How to license Python software with keys?

2 points by adawg_4 ↗ HN

3 comments

[ 0.26 ms ] story [ 18.2 ms ] thread
Perhaps you could expand a little more on what you're actually asking. As it stands, this is seriously under-specified.

* What are you trying to achieve?

* What failure modes are you looking to avoid?

* What are you expecting your users to do?

Just ... what are you asking?

I am creating a desktop piece of software via python and I need to have license keys for x amount of time to use the software (ex. lifetime, yearly, monthly). It would be awesome if it could connect to stripe. The thing im looking for is an easy to integrate method where I can automate the keys and manage them in the cloud without reinventing the wheel.

Here's the way I hope it will work: Users buy it through stripe checkout An email is sent with the key Users enter the key into a gui with the key input Users key is validated Users can use the software for as long as they pay for it.

Thanks in advance!

A quick web search turns up

https://cryptolens.io/2019/01/python-code-for-software-licen...

I've never used it; this is not a recommendation.

That said, it's not a difficult thing to implement. Generate a keypair, embed the public key in the application source, use it to decrypt a pickled dictionary containing whatever attributes you want to license.

Remember that being Python, it's easier than most languages to find the if statements that need to be bypassed to remove the licence checks.