如何通过系统时钟篡改来防止过期许可证的使用? [英] How to prevent usage of expired license through system clock tampering?

查看:1037
本文介绍了如何通过系统时钟篡改来防止过期许可证的使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用java处理许可证管理器,我将指定应用程序的开始日期和结束日期,以便我可以强制许可用户在一定时间后重新许可该程序。

I am currently working on a license manager using java, I will be specifying a start and end date for my application so I can force a licensed user to re-license the program after a certain amount of time.

但我遇到的问题是,任何人都可以回滚他们的系统日期和时间,以保持许可证的有效性。 Java中是否有任何方法可以检测系统日期和时间是否已更改。我已经尝试过网络时间协议来从时间服务器获取当前日期和时间。

But the problem I am facing is that any one can roll-back their system date and time in order to maintain the validity of license. Is there any way in Java to detect the system date and time is changed. I have already tried Network Time Protocol to get the current date and time from a time server.

推荐答案

您可能正在存储许可证系统上的文件。 a)包括软件在许可文件中注册的时间,b)对文件进行数字签名。

You likely are storing a license file on the system. a) include the time that the software was registered in the license file, b) digitally sign the file.

数字签名将告诉您许可证文件是否被篡改。如果没有,时间将告诉您软件何时注册;如果当前时间小于注册时间,您的许可证管理员会知道一些有趣的事情,它可以响应(拒绝运行,删除许可证,...

The digital signature will tell you if the license file was tampered with. If not, the time will tell you when the software was registered; if the "current time" is less than the registered time, your license manager knows something funny is going on and it can respond according (refuse to run, delete the license, ...

如果你真的想强制执行日期范围,请将每个程序执行的当前时间写入单独的数字签名文件,验证时间总是单调上升。

If you really want to enforce the date range, write the current time on each program execution to a separate digitially signed file, verifying that time always goes monotonically up.

您还可以根据应用程序写入然后读取的任何文件检查上次记录的时间。这样一个日期晚于上次记录时间的文件表示某种许可文件回滚。

You can also check your last recorded time against any files your application writes-then-reads. Such a file with a date later than your last recorded time indicates some kind license-file rollback.

这些不会阻止用户将时钟设置回来,但这将使他很难以有组织的方式完成这项工作。

These wont stop the user from setting the clock back some, but it will make it pretty hard for him to do this in an organized way.

这篇关于如何通过系统时钟篡改来防止过期许可证的使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆