Tips & Hints for
Shareware/Freeware Authors

Written by Matthias Kahlert, mkahlert@kagi.com
http://www.GeoCities.com/SiliconValley/Pines/8031/index.htm


General Information: Secure Registrations

Many good shareware applications are cracked or patched. But how can you protect your application against hackers and crackers? Here are some ideas...


Saving the Registration Key

If a user registeres for a shareware application he usually has to enter a registration code somewhere inside this application. But after the program has been registered, where is that key saved?

There are some possible ways:

Like you can see, all possibilities have advantages and disadvantages. Perhaps it is be a good way to combine that ways... But that's you decision.
Think about how to handle updates, what happens if the user gives away a copy of the program, etc.
Or why should you save the complete code on the harddisk? In most cases it is enough to save a handler that shows, that this is a registered version of the application.

If you give hackers a chance to find out the complete code, it may be easier for them to find out how that code is generated.

Another tip:
Never show the registration code anywhere inside your application! After the user has entered the code, don't let it appear in the about box, the main window or somewhere else! Just show the name of the registered user, nothing more.
Why? Many shareware magazines show screenshots of reviewed shareware applications. If they use a registered copy of the application in their review, it may happen that they display the registration code...
Just browse through some older issues of some magazines, they sometimes forgot to hide the code. (that also happened to some major applications like Photoshop or Illustrator).

Cracks and Patches

Often hackers try to crack shareware applications by finding out a way how to create the registration code. If that doesn't work, they try to patch your application by deleting the code that validates the code.

In most cases you can't prevent the hackers from doing this, but you can make it more difficult for them.

In order to prevent patches, you can run a checksum of your program code on startup, and if it is not what you expect when you shipped it, you could bring up a dialog informing the user that the program has been altered, and quit. Again as was mentioned earlier, you should make the "if" statement(s) for this check obscure so they can't be hacked around either.

This checksum can also be used as a nice virus scanner, because viruses also alter the application code.

UNREGISTERED VERSION

If you use any constant strings to show, that the user is working with an unregistered version, do not put that string directly into your code. Try to hide it or to encrypt it.

If you have an application that let's the user print out any data, you should put a text like "This has been printed with an unregistered version of XXX" onto the printout.
If the user likes your application but doesn't want to register for it, he perhaps may try to find that string using a hex editor and overwrite it using some spaces. But if you encrypt that string, it is nearly impossible for the average user... (Think about how easy it is to use a hex editor or ResEdit).

Annotations

If you have any other ideas about how to protect shareware applications against cracking and patching, please let me know. Just send an e-mail to mkahlert@kagi.com.


Modified on 19. July 1997


Back
1