Click here to Skip to main content
15,890,506 members
Articles / Programming Languages / C++
Article

Implementing simple Copy Protection : Technical overview

Rate me:
Please Sign up or sign in to vote.
3.11/5 (14 votes)
7 Jul 20024 min read 130.4K   32   31
Part 1 of a 4 part series on developing a simple copy protection method for your applications. In this article, I will discuss concepts on how such protection can be implemented.

Introduction

With the plethora of emergent software technologies, methods for deploying those technologies, and with the prospect of pay per use software on the horizon, there has been a steadily growing trend of sites catering to users who do not wish to pay for such services and as such download them illegally. This has the after effect of diminishing profits made by software companies and home based software programmers. As the trend increases, there is a progressive upscaling of the cost of software to the end user as well as a decrease in the amount of profit that a software company of freelance programmer is able to draw from his or her work. One solution to this is the eventual withdrawal of the software product from the market, which in turn forces layoffs of programmers that were specifically dedicated to that project. Another solution is the implementation of copy protection, which serves to curtail illegal software usage. Below, I will discuss a few possible methods of implementing simple copy protection to help avoid this problem.

Method One - DeadBolt Locking

The above name may seen somewhat strange, but in effect the first method, functions almost exactly as a deadbolt on your front door would. We can use a simple DLL which must be present for the application to execute as it would contain a null function ( basically just a void function that goes nowhere and does nothing ) which the program would need to see from the dll's exports. The main advantage of this, is that when linked in the applications header files, if the dll is not present on the system, the app will fail to execute, which is true in any case where a dll is not available. The main drawback to this is that the dll can be easily passed from a legitimate version of the application to an illegal warez version of the application so that makes it unsuitable for our purposes.

Method Two - Keypad Locking

This method takes the DeadBolt Locking method a step further and requires that the end user enter an authorization code which is parsed by a auth routine inside the dll and a corresponding counter code generated. This has the advantage of getting past the "floating" dll problem in that if the user enters an invalid counter code at set number of times, we can simply not allow them to run the program. It would do no good for them to keep trying the to try to guess the counter codes as the dll would generate a new authcode, countercode pair per each call and the chances of a correct guess would be unrealistic depending on the size of the authcode and it's respective counter code. The draw back to this is the fact that if someone where to sit down and disassemble the application they could possibly see what values were being passed between the dll and the main application and develop a key logger, or determine a way to patch the dll to accept a predetermined counter code each time.

Method Three - Remote Server Authorization

It is my personal opinion that the third and final method is the most secure and reliable method. It incorporates the previously defined methods and in addition some self check methods, which would be specifically designed to prevent tampering with the application files. The application could scan it's own dll's looking for and gathering information on file sizes, and send this information to a remote server for processing...if the file sizes or other information did not match, then the application could take appropriate steps to disallow running on the system it's installed on. This method is the best in my personal opinion because it provides an outside check which is difficult if not impossible to stop. This method and the two previous will be elaborated on in part 2 of this series. Stay Tuned.

P.S.

There are probably far better methods for implementing any kind of worthwhile copy protection, I am merely writing this series as a quick and dirty primer on methods for implementing such things. I make no promise of 100% correctness, and all concepts should be taken as written. If you choose to implement a method I have described in this article, don't blame me if it doesn't work....but if it does...credit me all you want :-)

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
My name is John Aldrich. I have pursued programming as a hobby for the past 6 years and currently have experience in Perl (basic / intermediate), HTML (advanced), and I have recently begun to learn C/C++. I also have a profound interest in all things graphics related and and constantly working to improve my knowledge in all areas of computing. I run a home based web software company named Professional Design Resources. If you are interested in any custom programming or would be interested in collaberating on a joint project, please feel free to contact me via email, where I'll be happy to discuss such things. Serious projects only please.

Comments and Discussions

 
QuestionWhere is part 2 of this article? Pin
William Kent18-Oct-11 6:52
William Kent18-Oct-11 6:52 
GeneralSo many misconceptions! Pin
John Browne9-May-11 14:03
John Browne9-May-11 14:03 
Generalgo for the minimalist Pin
aodry1-Feb-11 4:24
aodry1-Feb-11 4:24 
Hi there

In the past few months / years I was working on implementing / integrating copy protection system and function encryption to avoid code theft. I would like to help for some of you to clear the big picture.

Basically, there are two major type of market you might want to enter with your application.
1. B2C (business to customer), when you have a product which anyone can buy. Ie. games, os such as windows, editors, etc... endless.
2. B2B (business to business), when your client are companies. (ie. Hospital data system, Racing track, game studios, etc)

Depends on which business are you entering there are real big differences on copy protection requirements.
I believe every protection can be cracked, but some are really difficult while others are easy. I don't see the reason to put too much effort on B2C side, since anyone can get your app, and if it's a cool one it will be cracked! I would recommend to go for a simple enough solution which helps you to protect your app from an easy duplication. So your user cannot copy it, but needs to be cracked first. Even if it is easy, 99.999% of the users are not capable of that. Once you see that someone crack it and it's spreading on the net, you should feel good about it, since it means you made a cool app. And it's probably the time to think about some update of your app.
(another nice trick is to use upgrade mechanism to check validity - and deny upgrade if the application not authorized)
If you are in this business make it easy for you! Make a free version and a paid one with extra features which your users will love! If the price of your features worth, people will buy it! (even if some will not.. )

Once it's about B2B, then it's a different scenario. I am using a copy protection / encryption system which is used by airports, hospitals, race tracks and many other big firms. Cracking an application like that are a different scenario, even if the protection is bad and easy to crack. These companies are connected in business level and you have written contract with them. While a hacker from nowhere who downloaded your app and crack it in Apatfalva hard to identify, the same type of activity would easily put someone to prison in B2B.
When it's about B2B, things are more serious and there are lawyers and big budget also involved. There is no "bored" hacker who come along in an airport and want to crack the control system just for fun and give it away for free for some other countries where law not yet known. Cracking such a systems requires lots of details and access which is only possible if your client allow that, which would be a serious crime and can be tracked down.
Yes it is hard to track down who cracked a $10 tools which anyone can get from internet, but it is not that hard when the tool worth more then few $100000 and you know all the customers who have it.

So If you are fishing for small fish, don't use your big metal wire it would just give you more headache then profit.
Once you are go for big fish, then you need to take it seriously and not only thinking in a good protection as part of your system, but as part of your contract too.

And yes, there are protection system which was not yet cracked since its existence, but those are heavy, expensive and needs experts to installing them in client environment.

Hope this helps for someone.. Smile | :)

Have Fun!
GeneralCD data copy protection from one Cd to anather Pin
sushilabhanvar23-Jun-09 21:19
sushilabhanvar23-Jun-09 21:19 
Generalnot great Pin
Anonymous9-Aug-05 12:40
Anonymous9-Aug-05 12:40 
GeneralRe: not great Pin
Manish K. Agarwal7-Mar-06 20:03
Manish K. Agarwal7-Mar-06 20:03 
GeneralHistory of copy-protection Pin
Anonymous18-Jul-04 5:07
Anonymous18-Jul-04 5:07 
GeneralRe: History of copy-protection Pin
William Kent18-Oct-11 6:46
William Kent18-Oct-11 6:46 
GeneralAnother Problem Pin
Andy N15-Jul-02 21:11
Andy N15-Jul-02 21:11 
GeneralMethod 3 Easily Pin
Rogerio Silva15-Jul-02 4:11
Rogerio Silva15-Jul-02 4:11 
GeneralA nuisance to legitimate users Pin
Daniel Andersson9-Jul-02 3:27
Daniel Andersson9-Jul-02 3:27 
GeneralRe: A nuisance to legitimate users Pin
Mario M.9-Jul-02 4:02
Mario M.9-Jul-02 4:02 
GeneralRe: A nuisance to legitimate users Pin
Anonymous9-Jul-02 8:10
Anonymous9-Jul-02 8:10 
GeneralIdeas Pin
S van Leent9-Jul-02 3:05
S van Leent9-Jul-02 3:05 
GeneralIt only has to be cracked by 1 person Pin
wogerdoger2-Sep-03 8:16
wogerdoger2-Sep-03 8:16 
GeneralMethod 3... Pin
krism8-Jul-02 15:48
krism8-Jul-02 15:48 
GeneralRe: Method 3... Pin
John Aldrich8-Jul-02 15:55
John Aldrich8-Jul-02 15:55 
GeneralRe: Method 3... Pin
Anonymous9-Jul-02 8:50
Anonymous9-Jul-02 8:50 
GeneralRe: Method 3... Pin
Philippe Lhoste15-Jul-02 22:04
Philippe Lhoste15-Jul-02 22:04 
Generalyou are near... Pin
Mario M.8-Jul-02 15:21
Mario M.8-Jul-02 15:21 
GeneralRe: you are near... Pin
krism8-Jul-02 15:35
krism8-Jul-02 15:35 
GeneralRe: you are near... Pin
Mr Morden8-Jul-02 17:28
Mr Morden8-Jul-02 17:28 
GeneralRe: you are near... Pin
Paul Ingles8-Jul-02 22:39
Paul Ingles8-Jul-02 22:39 
GeneralRe: you are near... Pin
Mario M.9-Jul-02 3:46
Mario M.9-Jul-02 3:46 
GeneralRe: you are near... Pin
Mario M.9-Jul-02 3:47
Mario M.9-Jul-02 3:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.