Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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: 43028
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.
 
today's feeble attempt to support the empire
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic