AutoHotkey Community

It is currently May 26th, 2012, 6:22 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 290 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15 ... 20  Next
Author Message
 Post subject:
PostPosted: December 25th, 2008, 7:13 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Icarus wrote:
posting any real code for a trial mechanism, will immediately kill its usefulness, since people will be able to override it.
You can change the registry key to your secret choice, so hacking will be harder, but with a registry change tracker it is still not difficult. But you don’t have to hide this information. You can even store the expiration date in the registration file. If it (or the date in the registry key) is encrypted together with the PC fingerprint, an attacker cannot play with it. If it is missing or decrypts something invalid, your program quits. The expiration time cannot even be copied over from another PC, because the PC fingerprints are different.

The issue is to determine the current time, when the program runs. If the registration code you send to the user has the encrypted expiration date, your program will be responsible to compare it to the system date/time. There are many things you can do to combat a date resetting attack. One is to check the date of Windows system files, which change often, and if your program detects an inconsistency, quit. If you can assume a live Internet connection, you can query a time server, instead of the system time. An attacker can catch and manipulate the time, though, so you have to use an authenticated time server, or create your own, which sends the time encrypted with a secret key.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 27th, 2008, 6:59 pm 
I think the problem with that is that you have to send the user the code for the trial and in my opinion that is going to impact on sales dramatically. I've been getting a date off the net and that has been going well, but it restricts me to running trials intermittently, ie, I can't just run them all the time. I know people who run a 7 day trial once per month for example and this has obvious drawbacks. But the security is good.

I thought the following would be a possible solution. To make an exe that works as a trial with the option to license during or after the trial, only lasting two or three days to make it annoying and less appealing to try and cheat- when the user removes the Software it leaves a registry entry stopping (most of) them from using your trial again. So when they start it the first time it connects to the net and get's the date as the start point, if there is no internet connection it shuts down. Can this script be used to make that method any safer? If someone works out how to run it over and over then that's why I think the compromise of a short trial is worth it, genuine people get a reasonable look at the Software but it is too annoying to endure for people trying to and use the system clock method etc, they are going to have to do it every three days. The ones who will put up with that, well they aren't ever buying it anyway. I think the negative of the short trial is insignificant compared to the increased benefit from more people trying your Software.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 27th, 2008, 7:42 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
With trial periods of unregistered SW the issue is permanently storing data in the client machine. A registry key change can be found by a registry tracker, a hidden file - with a disk monitor. You can play with slack areas of certain, rarely changing files, but these can be cleaned by some utilities, too, so there seems to be no secure way to enforce a trial period without Internet connection. There are also fast incremental backup programs or secure disk drives, which restore the disk to an earlier snapshot, undoing any data hiding attempts.

Over the network we could offer a personalized version of the program to be protected. The user downloads and runs a small installer file, which sends the PC fingerprint to our server, and downloads the actual program which our server modifies to include an encrypted expiration date, and saves the PC fingerprint in a database on the server. (We need some automatically run server scripts for that.) If the user tries to re-install the program, our server finds the PC fingerprint in the database, and does not provide another trial version.

Btw, the number of runs is not easier to control than a trial time period: Each time our program starts it needs to change itself, a registration file or the registry, but all these can be easily restored to an earlier saved state. Controlling the trial time period only needs a trusted system time.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 31st, 2008, 5:21 am 
I guess the time trial is better than the number of uses anyway, I was more thinking from the point of view of security if it made it better but as you say, it all comes back to the date anyhow one way or the other. But the Website option you propose there is a beauty.

I have the script up and running and have successfully registered some users by the way. Thanks so much to both of you. :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2009, 7:32 am 
As RC4 has to be ideally converted to Hex beforehand for always a true result but i notice the script does txt2Hex so the number first has to be decimal or characters. How would it possible to accept a Hex code and output as Hex. Basically input hex > RC4 > output hex.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2009, 4:40 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
It is not hard, but what is the point? The binary or built-in encryption is faster, safer and handles binary data.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 15th, 2009, 3:01 pm 
Offline

Joined: November 28th, 2007, 9:54 am
Posts: 69
I have read up on TEA encryption and there is several weaknesses. THe original TEA maybe more than adequate for this protection neverless in the name of completeness and being a encryption expert concerned with security very much i thought you would of gone for the stronger XXTEA :) to correct the weaknesses in the original TEA.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 15th, 2009, 5:09 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
The included function is XTEA. Still, for higher speed and security, use the Windows' built in AES.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 20th, 2009, 5:54 pm 
Offline

Joined: August 25th, 2005, 9:40 pm
Posts: 129
I've gone through the thread and installed two libraries.
--SWProtect-GUI.ahk
--SWProtect-Internal.ahk

from here: link


added this code to my script:

Code:
SWP_Initialize( 0x81645732, 0x19573549 )    ; Up to 8 secret keys,
SWP_CheckRegistration( "My Application", "software@developer.com" )     
Gosub RunMyApp

Return
#Include SWProtect-GUI.ahk

RunMyApp:
   msgbox Registration is good, moving on
Return


and get this error message:

Code:
---------------------------
#Include file "SWProtect-GUI.ahk" cannot be opened.
---------------------------
 

________
Hotels In Mexico


Last edited by webber on March 11th, 2011, 12:32 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2009, 6:00 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
I think you are mixing the two methods.

You either #include, or put it in the library.

So, your script may work if you do ONE of these two options:
1. Remove the #include directive.
2. Put the TWO SW*.ahk files in the same folder as your script.

I never worked with the library option - I am always including.

HTH

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2009, 8:26 pm 
Offline

Joined: August 25th, 2005, 9:40 pm
Posts: 129
I moved things around - I now have this:

these two files are in the includes folder

--SWProtect-GUI.ahk
--SWProtect-Internal.ahk

Code:
...
#Include includes\SWProtect-GUI.ahk

SWP_Initialize( 0x81645732, 0x19573549 )    ; Up to 8 secret keys,
SWP_CheckRegistration( "My Application", "software@developer.com" )     
Gosub RunMyApp

Return
RunMyApp:
   msgbox Registration is good, moving on
Return

...


when I run the script now, it yields:
Quote:

Error in #include file "C:\..\includes\SWProtect-GUI.ahk": Call to nonexistent function.

Specifically: SWP_IsUserAuthenticated( SwpGuiVal_Name, SwpGuiVal_Email, SwpGuiVal_Key ) )

Line#
206: }
211: ExitApp
212: Return
215: Gui,%SWP_GuiID%:Submit,NoHide
216: if ( SwpGuiVal_Name = "" || SwpGuiVal_Email = "" || SwpGuiVal_Key = "" )
217: MsgBox,16,Invalid Registration,Invalid Registration.
Please check your input.
218: Else
---> 218: if ( Not SWP_IsUserAuthenticated( SwpGuiVal_Name, SwpGuiVal_Email, SwpGuiVal_Key ) )
218: {
219: MsgBox,16,Invalid Registration,Invalid Registration.
Please check your input.
220: }
221: Else
221: {
223: IniWrite,%SwpGuiVal_Name%,%SWP_IniFilename%,Registration,Name
224: IniWrite,%SwpGuiVal_Email%,%SWP_IniFilename%,Registration,Email

The program will exit.


________
Toyota ad engine


Last edited by webber on March 11th, 2011, 12:32 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2009, 8:35 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
There is a message, you are not using it right.

Notice that there is a test code inside the library itself.
As a general rule, I would suggest that when there is such a code, use it before you go on with deeper implementations - take it one step at a time.

Another general rule, includes are usually to be used after your Return statement unless specified otherwise.

That said, please do the following:
1. Make sure that both SW files are in the same folder
2. Create a new script and copy the below code into it
3. Make sure that folder does not contain any INI or any other file for that matter (just to make sure we have a clean testing environment)

The code for the test script:
Code:
#SingleInstance Force

SWP_Initialize( 0x81645732, 0x19573549 )    ; Up to 8 secret keys,
SWP_CheckRegistration( "My Application", "software@developer.com" )     
Gosub RunMyApp

Return
#Include SWProtect-GUI.ahk

RunMyApp:
   msgbox Registration is good, moving on
Return


If you have done this correctly you should see a window popping, telling you that the application is not registered.

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 20th, 2009, 9:22 pm 
Offline

Joined: August 25th, 2005, 9:40 pm
Posts: 129
thanks, it was a path problem in the SWProtect-GUI.ahk file and a problem of when I included SWProtect-GUI.ahk in my file.


I have it all sorted out now. :D
________
Gs400e


Last edited by webber on March 11th, 2011, 12:32 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 2nd, 2009, 8:29 am 
Is there a problem when the user does a Windows re-format with this script or will the same code still be ok?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 2nd, 2009, 7:09 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
If COMPUTERNAME, HOMEPATH or USERNAME changes, the user has to re-register. You can always change the PC data tracked in the SW, if you want more or less protection.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 290 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15 ... 20  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher and 9 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group