• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • 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: 43024
76
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic