TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-01-2009, 01:46 PM   #1 (permalink)
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default How to check valid license without connecting to external server

Hey guys!

I've been working on a paid script and was brainstorming how I could protect my script against piracy. While I like products like IONCube, I do not like encoding a whole product - the user has to be free to make some modifications, right?

So what's my current idea? Have the user insert a key when installing, either in a config file or MySQL. If it's a trial version, you have to insert date the key was given.

Let's say you have a login class, or database class, something big that would be hard to rewrite, something that offers major functionality of the site and would be hard to replicate - this would be a class you have to encrypt with IONCube or SourceGuardian, this is important, otherwise people will see how keys are made. In the construct, or whatever function gets used a lot, parse the license details - if it passes the check, continue, else die.

The idea behind the generation of keys/checking them:
Get the server http host, remove subdomain or www. if wanted. Then, salt the http host + add date if it's a trial, reverse string, md5 it and sha1 it. This means the key would return false and cause the script to die if the domain does not have a license. The salt/generated password to check the site key with would have to remain private variables obviously for security reasons. Salt would be stored in the same class you have the function/the one you encrypt. This would also mean that you'd only have to encrypt the class once, and not every time someone buys a copy for their domain. the key should be pretty damn hard to crack!
Sam Granger is offline  
Reply With Quote
Old 05-01-2009, 02:14 PM   #2 (permalink)
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by Sam Granger View Post
Hey guys!

I've been working on a paid script and was brainstorming how I could protect my script against piracy. While I like products like IONCube, I do not like encoding a whole product - the user has to be free to make some modifications, right?

So what's my current idea? Have the user insert a key when installing, either in a config file or MySQL. If it's a trial version, you have to insert date the key was given.

Let's say you have a login class, or database class, something big that would be hard to rewrite, something that offers major functionality of the site and would be hard to replicate - this would be a class you have to encrypt with IONCube or SourceGuardian, this is important, otherwise people will see how keys are made. In the construct, or whatever function gets used a lot, parse the license details - if it passes the check, continue, else die.

The idea behind the generation of keys/checking them:
Get the server http host, remove subdomain or www. if wanted. Then, salt the http host + add date if it's a trial, reverse string, md5 it and sha1 it. This means the key would return false and cause the script to die if the domain does not have a license. The salt/generated password to check the site key with would have to remain private variables obviously for security reasons. Salt would be stored in the same class you have the function/the one you encrypt. This would also mean that you'd only have to encrypt the class once, and not every time someone buys a copy for their domain. the key should be pretty damn hard to crack!

That's pretty ambitious there. Are you sure it's foolproof?
I have played with ioncube back in the days, I thought it was really cool, and according to them, my PHP programs were suppose to run even faster than stand alone.

However I never really trusted that they were glitch free. I have my own issues with my own bugs, I felt it would have been even harder if there was an unknown issue and I wasn't sure if it was ioncube or my coding..
allworknoplay is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using curl to read a file from an external server? bdm Advanced PHP Programming 10 12-04-2007 12:46 AM


All times are GMT. The time now is 08:03 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design