• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Class Loader

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I created a multi-layered licensing and anti-piracy scheme.

This would include license logic based on system hardward, obfuscating and jar hash value validation.

With this said, I would like to protect the case in where the savy java programmer overrides one of the obfuscated license classes. Is there a way to ensure that the class is being used from the jar and not somewhere else (i.e adding an additional class or jar to the classpath).

i.e.
obfuscatedclassname.getClass().getName --- ensure that one is being used in the jar.

Code examples would be useful.

Thanks
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While you can make it progressively harder for a would-be attacker to crack the code by using ever more elaborate measures, a determined attacker will ultimately prevail.

I don't want to discourage you from protecting the app against casual hackers; just keep this in mind when designing these schemes.
 
Thomas Mcfarrow
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I agree, if a hacker could break larger systems like Microsoft, Adobe, etc... my scheme would be trivial.

I still would like to make it more difficult.
 
Ranch Hand
Posts: 225
Eclipse IDE Debian Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Sun Java Tutorial�s section on JAR files includes information on sealing packages, so classes from a package cannot be loaded from a different jar file; and on cryptographically signing jars to verify that they haven't been modified. If you make the appropriate classes final and sign and seal the jars, you can make things harder.

You should be looking at only running with a security manager enabled to enforce these rules.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just look into java boot classes... its pretty hard to support any type of truly secure scheme of class infection. You may want to integrate with JNI and class hashes, jar signing and the such, but ultimately, its an up hill battle.
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic