PDA

View Full Version : Solved: program expiration code



deanziegler
12-29-2004, 07:27 AM
anyone have any foolproof but simple code that i could use a program that will halt execution past a certain date .,....prompt the user that he needs to upgrade, extend, purchase etc. new program with maybe a msgbox then auto close database? thanks!

Ken Puls
12-31-2004, 09:42 AM
Hi deanziegler,

In short, No, I haven't, but I have a concept that may work for you. It isn't 100% foolproof, but if you have someone experienced and determined enough to deal with it, they'll find other means to break into your database anyway.

Have you considered adding keys to the registry tracking the date of install, or date of expiration? Adding an algorithm to generate a numeric key can add that one extra layer you may need. You should be able to read those keys each time you open access, and if it is outside of your desired range, give your msgbox and close the db.

A full suggestion:
-Assume the user installs on January 1, 2005 and you want a 90 day trial
-Create Reg Key with value of 01/01/05
-Create Reg Key with value of 11 (Month+day+year)*3/2 rounded off*
*The formula can be as complex or simple as you want here. I'd suggest another couple of steps to it myself... maybe [MM+DD+YY+(4 Digit Year of your birth)*5-(You favourite number)/2+(The cost of a sixpack today)] all rounded to 0 decimal places.
-Once the user buys a license, though, you just change the install date to another text value... say "Bud-wei-ser" and not a date at all.

You can then test as follows:
If the reg key matches "Bud-wei-ser" let the program run

If not:
1) Is the date under 90 days after the date of install AND
2) Does the numeric key of the date in the reg key match the numeric key that you committed using the above formula. (Say their 90 period runs out, they find the key and change the date to 05/01/05. The numeric key using the first formula would be 17, not 11, so you could identify that something had changed.)

If all's good, let the program run, else msgbox and Bye, bye!

As I said, not totally foolproof, but would get probably keep 99% of users from getting in. They key in the above is the algorithm's complexity (although you don't want to go overboard as you need to test it!) The user may find the keys and try to modify, but after a few unsuccessful attempts will most likely give up.

The other portion, of course, is to protect your VB project so that a user can't find out what the proper password is. Remember that the VB project can also be hacked as well though.

Just make sure you run this on a test project first though, not your main one. If you make an error, you could lock yourself out permanently, so always better to test on a file you don't care about.

Hope this helps,

brettdj
01-01-2005, 06:10 AM
My $0.02 worth is that if you use Kpuls method above then you are better off using an API call to hide the registry key as opposed to using VBA'S SaveSetting which places the key in a default directory

Ken Puls
01-01-2005, 10:59 AM
Hi Brett,

I agree with you completely. I'm working on a bit of an example, just for fun, so that we can see what comes of it. Ultimately, however, we have to keep in mind that if your user can strip the VBA project security, you're in trouble anyway.

What do they say? Locks keep honest people honest, right?:yes

ALaRiva
01-01-2005, 11:02 AM
You might also want to look at my friend's site here - http://members.shaw.ca/glenk/index.html

Choose your version on the left, and then look for 'Expire Database Demo'.

It's just one method you can try. He and I both had a method that we were manipulating that was very slick and didn't allow for some workarounds that can be used to get past this demo version, but we haven't finalized it, and sort of put it on the back burner.

- Anthony

deanziegler
01-03-2005, 07:03 AM
Thanks guys for all the followups .. since my post i have stumbled across KNK's "Have the DB expire after 30 days" and have incorporated their Expiry Mod into my DB. Its kind'a slick storing data hidden in a user defined property.value in a mod and i have a working model that seems to work fairly well and that will keep it 99% secure. ( yeah always someone who will seem to be able to hack through it i know) however it just may serve my purpose ( job security is my goal here ha ha) ....in any event ... even though the form i use "setExpiry" (to set and /or change parameters, reg codes passwords etc. in the mod properties) is not inside the database as a precaution to make it even more secure... as im testing ,it i do see the need to disable "press shift" at DB startup for even more security due t the fact that the code that controls the bailout is in an autoexec macro...can anyone tell me quick how to accomplish disabling the"shift key at startup bypass"? Thanks and il keep you posted on how its coming along Thanks again.

deanziegler
01-03-2005, 10:39 AM
found a slick utility to disable the shift key...sorry its from another forum but wanted share it nonetheless thanks !
http://www.utteraccess.com/forums/showthreaded.php?Cat=&Board=48&Number=233728

ALaRiva
01-03-2005, 12:21 PM
however it just may serve my purpose ( job security is my goal here ha ha) ....
If you are setting up this code to not allow your company to use your program if you leave or are terminated, I would suggest that you not.

That is illegal. If you are being paid by the company to develop a program, you can't hold the application over their head for leverage in keeping a job.

Just take this as a warning as I have seen a few people do this and end up in serious legal trouble over it.

- Anthony

OsmarJr
01-25-2005, 04:56 AM
Take a look at www.activelock.com (http://www.activelock.com).

Paleo
01-25-2005, 07:05 AM
Remember you may do great things using Office 2003, Visual Studio 2003 and VSTO. You can create dlls and any other files to make it very hard to break. You may even use criptograph and hash keys. Its a lot safer then VBA and I do agree with Anthony. Lawsuits happens all the time over that practice of locking down firms applications even if its trully not that hard to break any security you create using VBA. You will find many softwares that do this for you at the internets underground, I just wont post any url here because I dont think it would be appropriate.

Paleo
01-25-2005, 07:07 AM
Cool link Osmar Jr. Thanks.