I've wrote a standalone java SE software which executes, for example, the features A, B and C.

Now, i want to that, if a lock is enabled (and this lock is a command sent remotely by my backend), the feature C has not to be longer available for execution by the user.

This lock has to be persistent, so, it has to survive to a device reboot, for example.

Another requirement is that has to be secure, so, it cannot to be just a file nor an entry on a local DB nor anything that could be manipulable by an expert user.

What is the best solution for develop something like that?

  • Sharing your research helps everyone. Tell us what you've tried and why it didn’t meet your needs. This demonstrates that you’ve taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see How to Ask – gnat Nov 11 '15 at 9:57
  • What i've tried was to use both a file as a lock and both an entry on local db, but none of these solutions has proved to be satisfactory for my security needs. I've no other ideas about how i can solve this, i'm just asking for some new ideas, not for a source code ready and working. :) – wyr0 Nov 11 '15 at 10:03
  • 2
    You're talking about DRM. Every major program with DRM has been cracked to get around it (in some cases, "just because"), and this is with millions of dollars spent by other companies. Barring a feature requiring a resource physically under your control, it'll be circumvented. Among other things, what happens if somebody installs your program and then takes their machine off the network? – Clockwork-Muse Nov 11 '15 at 11:52
  • please be more specific - what device is this software of yours running on, how do you communicate with it, what is the software stack available, what have you tried and what did not work out? you'll have a chance then that the put-on-hold banners-in-charge show mercy and lift their spell :-). then someone might actually be able to give a decent answer. – miraculixx Nov 11 '15 at 16:33

As Clockwork-Muse pointed out in a comment, this ability to enable/disable features is known as DRM.

Since you want to be able to remotely disable feature C, it seems reasonable to assume your target computer is connected to the Internet.

It might be enough for your code to "call home" to a server periodically with a message "this is box XXX, license # YYY, version a.b.c. What features should I enable?". If it does not get a reply, it can fall back to the most restrictive answer. It can also store an answer in memory for a short period of time if necessary.

It's not foolproof, but hopefully it's enough to help the mostly-honest people stay honest and convince the dishonest people their time is better spent on easier targets.

Not the answer you're looking for? Browse other questions tagged or ask your own question.