Possible Duplicate:
How are Software License Keys generated?
I am a beginner in software developement and I would like to know how to implement a protection system on my Java app to protect it against piracy. I know that there's no perfect solution. But i just want to know how protect it. And don't tell me to make it open source,it's impossible in my case :).
Thanks for your time and answers.
As any license enforcement solution can be cracked with a bit of effort, I suggest you don't try to implement copy-protection at all. License management is just inconvenient for your users.
If you are determined to implement copy-protection, you can use an open-source library.
Additionally, you should obfuscate your byte code to make it slightly more difficult to reverse-engineer your application.
I considered this some years ago. Eventually I decided not to license it; I gave it away for free but I think my best idea was:
Send them a license file containing a key. Name the file with their full name and e-mail address or something equally personal and make sure renaming it will invalidate the key. This should be simple to achieve. There are many techniques you could use that would not require storing the key in your application.
Like any system, this is not uncrackable but as was explained to me many years ago, security is for keeping honest people honest.