0

我想为我的客户创建一个程序的试用版。我想给他/她一些时间来测试程序(在这种情况下是 7 天)。

我在应用程序中有这个命令(在 *.py 文件中):

 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()

我很好奇这种方法是否足以满足普通客户的需求,或者我是否必须改变它。问题是应用程序必须找到一个名为“some_chars.txt”的文件。如果找到该文件,则应用程序将按照它必须的方式工作,如果没有,它会返回一个文本“试用版已过期”。

所以主要的问题是——对于普通客户来说足够了吗?它可以在某个地方找到还是被编译成机器代码,所以他不得不反汇编它?

编辑:我忘了提到非常重要的事情,我正在使用 py2exe 制作一个包含不必要文件和文件夹的可执行文件(主文件)。

4

2 回答 2

0

Python是解释的,所以他们所要做的就是查看源代码以查看时间限制部分。

有一些将 python 脚本转换为可执行文件的选项。我会尝试这个并且不使用任何外部文件来设置日期,将其保存在脚本中。

于 2015-07-28T23:50:27.493 回答
0

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")

于 2015-07-29T00:41:19.363 回答