Milano
Milano

Reputation: 18745

Time trial version of a program

I want to create a trial version of a program for my customer. I want to give him/her some time to test the program (7 days in this case).

I have this command in the application (in *.py file):

 if os.path.isfile('some_chars.txt') or datetime.now()<datetime.strptime('30-8-2015','%d-%m-%Y'): 
# DO WHAT application HAS TO DO
else:
    print 'TRIAL EXPIRED'
    quit()

I'm curious whether is this approach enough for common customer or whether I have to change it. The thing is that the application has to find a file which name is, let's say, 'some_chars.txt'. If the file was found, the application works as it has to do, if not, it returns a text 'Trial version expired'.

So the main question is - is it enough for common customer? Can it be found somewhere or is it compiled to machine code so he would had to disassemble it?

EDIT: I forgot to mention very important thing, I'm using py2exe to make an executable file (main) with unnecessary files and folders.

Upvotes: 0

Views: 2697

Answers (2)

CristiFati
CristiFati

Reputation: 41177

Of course it has everything to do with the target (population) you're aiming: there are some cases when security is an offense (that involves lots of money so it's not our case);

Let's take an example:

  • Have a program that reads plain data from a file(registry,...); e.g. :the date (the program converts the date does a comparison and depending on the trial period close or lets the user go on)

  • Have everything from previous step, but the data is not in plain text, it is encrypted (e.g.: 1 is added to every char in the data so it is not immediately readable)

  • Use some well known encryption algorithms (would make the data unreadable to the user)

But, no matter the method you choose, it's just a matter of time til it will be broken.

A "hard to beat" way would be to have an existing server where the client could connect and "secretly talk" (I'm talking about a SSLed connecion anyway), even for trial period.

"Hiding the obvious info"(delivering a "compiled" .py script) is no longer the way (the most common Google search will point to a Python "decompiler")

Upvotes: 1

Kim Ryan
Kim Ryan

Reputation: 515

Python is interpreted, so all they have to do is look at the source code to see time limiting section.

There are some options of turning a python script into an executable. I would try this and don't use any external files to set the date, keep it in the script.

Upvotes: 0

Related Questions