How to protect my AHK scripts?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
chezzoc
Posts: 18
Joined: 04 Jul 2022, 02:53

How to protect my AHK scripts?

Post by chezzoc » 26 Nov 2022, 07:09

Hi. I wrote AHK scripts that took over two thousand lines that help people in certain games. I sold the script to someone to then find out few weeks later my script is almost with everyone as it got leaked. so I want to avoid such stuff in the future, I looked up in google for ways to protect my files but I wasnt able to find a suitable way to do so. I basically want to be able to give a copy of my script that will work only on his computer and no one else.. I have no idea how to go about this. or maybe being able to disable the script for specific people.. i really dont know how to go about it. if anyone has an efficient simple way please let me know..

User avatar
mikeyww
Posts: 26600
Joined: 09 Sep 2014, 18:38

Re: How to protect my AHK scripts?

Post by mikeyww » 26 Nov 2022, 07:23

Hello,

This forum has several posts about protecting scripts. You could search the forum: protect, license, register, etc.

RussF
Posts: 1242
Joined: 05 Aug 2021, 06:36

Re: How to protect my AHK scripts?

Post by RussF » 26 Nov 2022, 08:29

So...um...you're asking for free help on a free forum for free software to make sure you get paid for your work? I can't help but chuckle at the irony. The battle between developers and pirates has been raging for almost 50 years, especially in the gaming community. Welcome to the world of software development. You could just pay it forward by distributing it for free and be a hero in your community.

Russ

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: How to protect my AHK scripts?

Post by boiler » 26 Nov 2022, 09:01

@chezzoc — This only works in particular situations, which I have used pretty successfully and could be your case: If your script is meant to be used only with a certain application that requires user logins and you have access to a server that the script can read from, you can register users by their username for that other software. You would also need to be able to determine which user is logged in locally.

Although it might seem easy enough for defeat it by simply removing the part of the code that does that check, there are ways to make key parts of the code not work if that part isn’t there that can be hard for them to figure out.

@RussF — There is nothing ignoble about making money from writing software that others find useful, and there is nothing wrong with developers sharing approaches to prevent people from illegally copying and distributing their software to others. Developers shouldn’t be shamed for seeking to make money from their efforts, and I don’t understand the view that people should feel it is their right to steal others’ work.

If you make clay pots, should you be required to “pay it forward” and give clay pots to everyone that wants one? Or should they be expected to compensate the maker of the clay pot with a reasonable price for something that is valuable to them? Go do your job for free and see if you are rewarded for it by others paying it forward by giving you your groceries, car, home, etc., for free.

RussF
Posts: 1242
Joined: 05 Aug 2021, 06:36

Re: How to protect my AHK scripts?

Post by RussF » 26 Nov 2022, 09:59

@boiler, ok, back-peddling here a bit. When I wrote that, I was primarily thinking about the adage, "Locks only keep honest people honest". It didn't seem like I was shaming at the time, but upon re-reading it, I see where it could be interpreted as such and I sincerely apologize for that.

I 100% agree with you that people should be compensated for their work. I have made good money in the past writing custom, vertical market, applications. I have never bothered with any form of protection because 1) any lock can be broken and 2) my apps have been so specific to the company commissioning them that they would be virtually useless to anyone else. That is also why I have stayed away from any horizontal market apps. The stress of wondering how many people have stolen my intellectual property just isn't worth it. Additionally, the copy protection code itself often exceeds the efforts put into the app that you're trying to protect.

I don't have a single piece of intellectual property (software app, movie, song, etc.) for which I have not paid the asking price because 1) I believe in fairly compensating people for their work and 2) that's just who I am. Unfortunately, there are others who don't feel the same, so if you're going to put software out that is valuable to many people, expect it to be shared. You can make it hard , but not impossible.

Your analogy of the clay pots is fitting only to an extent. I am a woodturner as well and have made objects that sold through galleries for a decent sum. I have also given away MANY pieces - but that was my choice. The difference is that the object is tangible. If I make a vase and sell it to you, whatever you do with it is not my concern. Making a quick copy and sharing it is not an option. If you want to go through all the training, work and effort to duplicate it and then sell it, I say, "go for it". However, if you've spent that much time to do that, you'll probably want to create your own unique pieces anyway. Intellectual property is not that way. Exact copies will be made. Protection schemes will be broken. Expect it.

Climbing off my soapbox,

Russ

User avatar
mikeyww
Posts: 26600
Joined: 09 Sep 2014, 18:38

Re: How to protect my AHK scripts?

Post by mikeyww » 26 Nov 2022, 10:17

You stopped locking your car door? Please send me the location, make, and model. Leave the key on the seat so that I will not need to damage the car. Thanks.

:)

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: How to protect my AHK scripts?

Post by boiler » 26 Nov 2022, 10:23

RussF wrote: When I wrote that, I was primarily thinking about the adage, "Locks only keep honest people honest".

Protection schemes will be broken. Expect it.
That analogy is very appropriate…when applied correctly. There are many people who will take something for free if it is sitting out in the open with no one watching, but they will not take the step of actively breaking into something to steal it. The reality is that software protection works to reduce the number of thefts. Many would-be thieves don’t have the ability nor the desire to go to more extreme measures to break copy protection schemes, but they will happily use software for free that is meant to be paid for but has nothing preventing them from using it without paying.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: How to protect my AHK scripts?

Post by boiler » 26 Nov 2022, 10:23

mikeyww wrote:
26 Nov 2022, 10:17
You stopped locking your car door? Please send me the location, make, and model. Leave the key on the seat so that I will not need to damage the car. Thanks.

:)
:lol:

RussF
Posts: 1242
Joined: 05 Aug 2021, 06:36

Re: How to protect my AHK scripts?

Post by RussF » 26 Nov 2022, 11:03

mikeyww wrote:
26 Nov 2022, 10:17
You stopped locking your car door? Please send me the location, make, and model. Leave the key on the seat so that I will not need to damage the car. Thanks.

:)
I've had one car stolen and two broken into by smashing the window. All were locked in well lit areas. ;)
boiler wrote: Many would-be thieves don’t have the ability nor the desire to go to more extreme measures to break copy protection schemes,
True, but all it takes is one.

Russ

User avatar
mikeyww
Posts: 26600
Joined: 09 Sep 2014, 18:38

Re: How to protect my AHK scripts?

Post by mikeyww » 26 Nov 2022, 11:21

So I gather that you actually have stopped locking your car door, to save on the glass repairs.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: How to protect my AHK scripts?

Post by boiler » 26 Nov 2022, 11:39

RussF wrote: True, but all it takes is one.
Not really, because your broken code can’t get widely distributed to others who otherwise would not steal it without publicizing it in some way. I had mine broken and distributed inside a pro poker group’s closed chat ring (which is already relatively contained), and one of my honest customers brought it to my attention, and the leader of the group who stakes them came down hard on them and paid for a bunch of licenses.

RussF
Posts: 1242
Joined: 05 Aug 2021, 06:36

Re: How to protect my AHK scripts?

Post by RussF » 26 Nov 2022, 13:00

So, ok, I'm the black sheep today, I understand, but I have broad shoulders. I thoroughly respect your opinions as I hope you do mine.

@mikeyww - No, I haven't stopped locking my car, but no, I don't put any locks on my software either.

@boiler - with the internet, distribution is easier than ever. Even back in the days of dial-up BBS's, you could find jail-broken copies of any game or application without any trouble at all as long as you were willing to wait for a lengthy download - and most were.

My point is - thieves will be thieves. All the locks in the world will not keep determined thieves out. With the car - one person benefits. With software, hundreds or thousands can benefit, so the motivation to steal is even higher.

All the coding knowledge I have acquired over the past five decades did not just magically appear. Sure, some came from books I purchased or classes I paid for, but the vast majority came from generous people, such as those on this forum, who gave of their time and knowledge to help me out, as well as from examining the source code of applications written by like-minded people who believe that sharing knowledge and contributing to someone's education is better than getting filthy rich.

Anyone of you using Linux (or Android) can thank Linus Torvalds who believed, "open source is the only right way to do software" ( https://en.wikipedia.org/wiki/Linus_Torvalds ). We need more Torvalds' out there and fewer Gates'.

Russ

User avatar
mikeyww
Posts: 26600
Joined: 09 Sep 2014, 18:38

Re: How to protect my AHK scripts?

Post by mikeyww » 26 Nov 2022, 13:17

Fair discussion. I don't think there's just one right way.

I think you disproved your point. You lock your car for a simple reason: it's a deterrent. Nothing more, nothing less.

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: How to protect my AHK scripts?

Post by boiler » 26 Nov 2022, 20:53

I take exception with the idea that one either wants to share knowledge or make money, as if they’re mutually exclusive. And I detest the notion that wanting to make money or having money is somehow “filthy” or that individuals with wealth are lesser people in any way whatsoever.

william_ahk
Posts: 481
Joined: 03 Dec 2018, 20:02

Re: How to protect my AHK scripts?

Post by william_ahk » 26 Nov 2022, 22:25

@RussF For automating everyday work sharing knowledge for free is beneficial to the community I agree. Personally I've learned very much from the community and now I'm also sharing my own. But for gaming that's a different story. People don't really care about the code, so it's reasonable for them to pay "fines" for not learning programming :lol: I'd also argue that on the contrary, hacking a script with a gaming incentive might even help them become programmers. Taking perfectly written code and then continue gaming certainly won't help.
As for the usefulness of software protection. Anything would help. I've seen authors simply converting the script to exe and adding a password for protection, and it deters most users from cracking. The script is just really not worth that much. Real hackers would probably just write one from scratch than to crack someone's crappy spaghetti code over 2k lines :trollface:

RussF
Posts: 1242
Joined: 05 Aug 2021, 06:36

Re: How to protect my AHK scripts?

Post by RussF » 27 Nov 2022, 09:26

I guess I have to be careful with the colloquialisms I use lest they be taken too literally or twisted out of context.

Everyone operates on different business models. I personally don't code on speculation. While that model can be very lucrative and works for many people, it is not for me - I don't need the stress. My work is all commissioned to fill a specific need for a specific company or individual. It works for me and while I will never become the next Gates, I have nevertheless made a very comfortable living at it. My clients and I agree on a price that is fair for both parties. The code is completely open and belongs to them, because they paid for it. If they want to give it away, that is their choice, but more often than not, I will instead get a referral and more business from someone else. I also realize that I'm not going to be around forever. I'm just one guy, not a large corporation. If I'm gone and that code breaks because of the latest Windows update or version, or needs to be modified, someone else can step in and fix the code. Everyone wins. That's just not possible with encrypted or protected software.

I have no secrets to hide, no revolutionary algorithms to protect, just solid code that fills a need. Any general purpose utilities I come up with are openly shared and if someone else can somehow learn or benefit from it, all the better - it's my contribution to society. Every one of us here uses software that is free and open source - AutoHotkey - and there is a long pedigree of contributors to this software who share similar ideals, as well as the countless people like yourselves who offer their help on this forum.

My philosophy is neither right nor wrong nor suitable for everyone. I respect your opinions and never meant to offend. I hope we can all agree to disagree on certain things.

Russ

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: How to protect my AHK scripts?

Post by boiler » 27 Nov 2022, 10:14

Yes, your model worked for you in your situation. It is definitely not the model to use in other situations where you don’t have one one client that provides significant compensation. Other models require selling to hundreds or thousands of customers paying a small price each before you start to get compensated for the months of effort you put in to it. That’s where software protection becomes important and even necessary.

I’m not giving my software that I spent months day and night developing to the community for free to be some kind of hero or something. They won’t even care who wrote it, they’ll just happily use it and boost their win rates on my labors. And that doesn’t mean that I don’t want to share knowledge for free, as I would hope my time on this forum demonstrates.

ahk7
Posts: 574
Joined: 06 Nov 2013, 16:35

Re: How to protect my AHK scripts?

Post by ahk7 » 27 Nov 2022, 10:33

I think AutoHotkey_H still has the /nodecompile option which may be enough protection (don't know how it works but no doubt documented somewhere on the forum)

Post Reply

Return to “Ask for Help (v1)”