activelock-development Mailing List for ActiveLock (Page 21)
Brought to you by:
ialkan
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(52) |
Aug
(170) |
Sep
(34) |
Oct
(62) |
Nov
(46) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(7) |
Feb
(2) |
Mar
|
Apr
(17) |
May
(14) |
Jun
(31) |
Jul
(59) |
Aug
(18) |
Sep
(3) |
Oct
|
Nov
|
Dec
(5) |
2005 |
Jan
|
Feb
(10) |
Mar
(3) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Thanh H. T. <th...@us...> - 2003-07-31 06:18:02
|
Update of /cvsroot/activelock/activelock2/src In directory sc8-pr-cvs1:/tmp/cvs-serv5362 Modified Files: ALCrypto.dll Log Message: Added len parameter to md5_hash() function - cannot rely on strlen(). Index: ALCrypto.dll =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ALCrypto.dll,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsSNwTJq and /tmp/cvskvPZ5I differ |
From: Thanh H. T. <th...@us...> - 2003-07-31 06:16:56
|
Update of /cvsroot/activelock/alcrypto In directory sc8-pr-cvs1:/tmp/cvs-serv5188 Modified Files: MD5.C Log Message: Added len parameter to md5_hash() function - cannot rely on strlen(). Index: MD5.C =================================================================== RCS file: /cvsroot/activelock/alcrypto/MD5.C,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MD5.C 31 Jul 2003 05:37:58 -0000 1.3 +++ MD5.C 31 Jul 2003 06:16:54 -0000 1.4 @@ -359,14 +359,14 @@ /** * API function to compute MD5 hash. */ -ALCRYPTO_API LRESULT WINAPI md5_hash(unsigned char *in, unsigned char *out) +ALCRYPTO_API LRESULT WINAPI md5_hash(unsigned char *in, int len, unsigned char *out) { static const char hex[] = "0123456789ABCDEF"; struct MD5Context md5c; unsigned char outBytes[16]; int i = 0; MD5Init(&md5c); - MD5Update(&md5c, in, strlen(in)); + MD5Update(&md5c, in, len); MD5Final(outBytes, &md5c); out[0] ='\0'; /* reset out buffer */ for (i = 0; i < 16;i++) { |
From: Thanh H. T. <th...@us...> - 2003-07-31 05:38:01
|
Update of /cvsroot/activelock/alcrypto In directory sc8-pr-cvs1:/tmp/cvs-serv31561 Modified Files: MD5.C Log Message: Oops! Forgot to update the change log. Index: MD5.C =================================================================== RCS file: /cvsroot/activelock/alcrypto/MD5.C,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MD5.C 31 Jul 2003 05:07:02 -0000 1.2 +++ MD5.C 31 Jul 2003 05:37:58 -0000 1.3 @@ -76,7 +76,8 @@ * * Date (MM/DD/YY) Author Description * --------------- ----------- -------------------------------------------------------------- - * 07/27/03 th2tran adapted from PuTTY project for used by ActiveLock project. + * 07/27/03 th2tran Adapted from PuTTY project for used by ActiveLock project. + * 07/31/03 th2tran Added md5_hash() function. * ***********************************************************************************************/ |
From: Thanh H. T. <th...@us...> - 2003-07-31 05:19:14
|
Update of /cvsroot/activelock/activelock2/test In directory sc8-pr-cvs1:/tmp/cvs-serv28651 Modified Files: ALCrypto.dll Log Message: Added md5_hash() function. Index: ALCrypto.dll =================================================================== RCS file: /cvsroot/activelock/activelock2/test/ALCrypto.dll,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsRevsDh and /tmp/cvsASBYXq differ |
From: Thanh H. T. <th...@us...> - 2003-07-31 05:14:23
|
Update of /cvsroot/activelock/activelock2/src In directory sc8-pr-cvs1:/tmp/cvs-serv27957 Modified Files: ALCrypto.dll Log Message: Added md5_hash() function. Index: ALCrypto.dll =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ALCrypto.dll,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvs6MzQup and /tmp/cvswrgTEG differ |
From: Thanh H. T. <th...@us...> - 2003-07-31 05:07:05
|
Update of /cvsroot/activelock/alcrypto In directory sc8-pr-cvs1:/tmp/cvs-serv26940 Modified Files: ALCrypto.def MD5.C Log Message: Added md5_hash() function. Index: ALCrypto.def =================================================================== RCS file: /cvsroot/activelock/alcrypto/ALCrypto.def,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ALCrypto.def 28 Jul 2003 01:01:03 -0000 1.1 +++ ALCrypto.def 31 Jul 2003 05:07:02 -0000 1.2 @@ -13,4 +13,5 @@ rsa_createkey @7 rsa_sign @8 rsa_verifysig @9 -rsa_freekey @10 \ No newline at end of file +rsa_freekey @10 +md5_hash @11 \ No newline at end of file Index: MD5.C =================================================================== RCS file: /cvsroot/activelock/alcrypto/MD5.C,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- MD5.C 28 Jul 2003 01:01:03 -0000 1.1 +++ MD5.C 31 Jul 2003 05:07:02 -0000 1.2 @@ -74,9 +74,9 @@ * Change Log * ========== * - * Date (MM/DD/YY) Author Description + * Date (MM/DD/YY) Author Description * --------------- ----------- -------------------------------------------------------------- - * 07/27/03 th2tran adapted from PuTTY project for used by ActiveLock project. + * 07/27/03 th2tran adapted from PuTTY project for used by ActiveLock project. * ***********************************************************************************************/ @@ -353,3 +353,23 @@ "hmac-md5", 16 }; + + +/** + * API function to compute MD5 hash. + */ +ALCRYPTO_API LRESULT WINAPI md5_hash(unsigned char *in, unsigned char *out) +{ + static const char hex[] = "0123456789ABCDEF"; + struct MD5Context md5c; + unsigned char outBytes[16]; + int i = 0; + MD5Init(&md5c); + MD5Update(&md5c, in, strlen(in)); + MD5Final(outBytes, &md5c); + out[0] ='\0'; /* reset out buffer */ + for (i = 0; i < 16;i++) { + sprintf(out + strlen(out), "%02x", outBytes[i]); + } + return 0; +} \ No newline at end of file |
From: AJcompany A. <ajc...@ya...> - 2003-07-31 01:25:47
|
Hi, I just got the Code Project newsletter, so I'm posting this article to the group. Here is a 'sdk' that's basically doing what we are, but with less encryption and more tending to "security through obscurity", and a lot easier to fake correct registration (or so I'd assume, I haven't tried). http://www.codeproject.com/useritems/ssdsdk.asp Hope it is helpful for someone, AJ --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software |
From: AJcompany A. <ajc...@ya...> - 2003-07-30 23:48:06
|
Ok, I was just (today) working with trying to get CVS source for the files, and I've got WinCVS and TortiseCVS (I use TortiseCVS), but I'd like someone to tell me how to get it working so that I can get (and put) files as my sf user (ajcompany). I currently try to get the files via anon, but that is (at least the last sf update said) about a day slow. On another note, I had some idea for an encryption/registration method (process follows): 1. client generate private/public key pair 2. client send public key (and some other info, whatever is usually used, possibly encoded in the key instead of randomness) to server 3. server encrypt a file with it's private key, and then the client's public key 4. server send file to client 5. client decrypts with it's private key and then with the server's public key (encoded in the client to begin with) 6. client checks registration and saves the decrypted file. The part that makes this special is that the file in step 3 would be an essential part of the program, such as printing, you can comment out the "make sure I'm registered" hooks, but you can't add in the print function without re-writing the program. An even better idea would to store the entire set of data the client got from the server and then unpack that file at runtime, and keep it in MEMORY ONLY so the file couldn't be replaced. (ok, there may be a flaw or so, feel free to point it out) Comment at will, AJ ----- Original Message ----- From: "Thanh Hai Tran" <th...@sy...> To: <act...@li...> Sent: Tuesday, July 29, 2003 7:28 PM Subject: [family] [ActiveLock-Development] Calling all developers... > Hi all, > I know everyone is very busy with either work or school. But since you're > in this group, it means that you want to help. > So rather than playing possum, here are some of the ways that you can get > involved: > > - Be active on the forum and on this mailing list. Generate discussion on > ideas, features, philosophical beliefs, whatever...but please.....none of > those non-productive BS that was going on in YahooGroup here please. > > - Check out the existing ActiveLock2 developement codebase from CVS, play > with it (there's a test app). > See Mr. Mike Crute for assistance in setting up CVS if you don't know > how. > Make suggestions on how the code/test app can be improved. > If you find any problem with the code, > either report it on SourceForge bug tracker > http://sourceforge.net/tracker/?group_id=70007&atid=526385 > or even better fix it yourself. > > - Check out the unassigned tasks on SF Task List > > http://sourceforge.net/pm/task.php?group_project_id=25539&group_id=70007&fun c=browse > See if any task that you can work on. Either talk to Mike Crute to be > assigned, or re-assign it to yourself > > We're getting close to the Alpha 1 release and we need all the help we can > get. But if you are not willing or able to help, then you shouldn't be in > the development team. Prolonged inactivity in the group will entitle you to > being kicked out of the project. > I apoligize if I sound harsh, but we need productive members in the team in > order for the project to be successful. > > Mike, please feel free to jump in and correct me if I sound out of line. > > Regards, > Thanh. > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Activelock-Development mailing list > Act...@li... > https://lists.sourceforge.net/lists/listinfo/activelock-development __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: Thanh H. T. <th...@sy...> - 2003-07-30 00:28:29
|
Hi all, I know everyone is very busy with either work or school. But since you're in this group, it means that you want to help. So rather than playing possum, here are some of the ways that you can get involved: - Be active on the forum and on this mailing list. Generate discussion on ideas, features, philosophical beliefs, whatever...but please.....none of those non-productive BS that was going on in YahooGroup here please. - Check out the existing ActiveLock2 developement codebase from CVS, play with it (there's a test app). See Mr. Mike Crute for assistance in setting up CVS if you don't know how. Make suggestions on how the code/test app can be improved. If you find any problem with the code, either report it on SourceForge bug tracker http://sourceforge.net/tracker/?group_id=70007&atid=526385 or even better fix it yourself. - Check out the unassigned tasks on SF Task List http://sourceforge.net/pm/task.php?group_project_id=25539&group_id=70007&func=browse See if any task that you can work on. Either talk to Mike Crute to be assigned, or re-assign it to yourself We're getting close to the Alpha 1 release and we need all the help we can get. But if you are not willing or able to help, then you shouldn't be in the development team. Prolonged inactivity in the group will entitle you to being kicked out of the project. I apoligize if I sound harsh, but we need productive members in the team in order for the project to be successful. Mike, please feel free to jump in and correct me if I sound out of line. Regards, Thanh. |
From: Thanh H. T. <th...@sy...> - 2003-07-29 22:17:16
|
Mike/Dan, Just you know...I think you can use wildcards. e.g. *.vbw ----- Original Message ----- From: "Michael E. Crute" <mc...@us...> To: <act...@li...> Sent: Tuesday, July 29, 2003 2:58 PM Subject: [ActiveLock-Development] CVS: activelock2/src .cvsignore,NONE,1.1 > Update of /cvsroot/activelock/activelock2/src > In directory sc8-pr-cvs1:/tmp/cvs-serv10905/activelock2/src > > Added Files: > .cvsignore > Log Message: > Updated to ignore the .vbw files generated by VB > > --- NEW FILE: .cvsignore --- > ActiveLock2.vbw > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Activelock-Development mailing list > Act...@li... > https://lists.sourceforge.net/lists/listinfo/activelock-development > |
From: Dan <wiz...@us...> - 2003-07-29 22:16:16
|
Update of /cvsroot/activelock/activelock2/src In directory sc8-pr-cvs1:/tmp/cvs-serv10832/src Added Files: modComputerName.bas modHDSerial.bas modWindowsSerial.bas Log Message: Oops... Forgot to add the new files first! Added support for locks other than MAC. Hopefully a new test app will follow shortly. - Dan --- NEW FILE: modComputerName.bas --- Attribute VB_Name = "modComputerName" ' /////////////////////////////////////////////////////////////////////// ' / Filename: modComputerName.bas / ' / Version: 2.0.0.1 / ' / Purpose: Gets the name of the computer on the network. / ' / ActiveLock Software Group (ASG) / ' / / ' / Date Created: July 28, 2003 - Dan Sanders / ' / Date Last Modified: / ' / / ' / This software is released under the license detailed below and is / ' / subject to said license. Neither this header nor the licese below / ' / may be removed from this module. / ' /////////////////////////////////////////////////////////////////////// ' ' ' /////////////////////////////////////////////////////////////////////// ' / SOFTWARE LICENSE / ' /////////////////////////////////////////////////////////////////////// ' ' ActiveLock ' Copyright 1998-2002 Nelson Ferraz ' Copyright 2003 The ActiveLock Software Group (ASG) ' All material is the property of the contributing authors. ' ' Redistribution and use in source and binary forms, with or without ' modification, are permitted provided that the following conditions are ' met: ' ' [o] Redistributions of source code must retain the above copyright ' notice, this list of conditions and the following disclaimer. ' ' [o] Redistributions in binary form must reproduce the above ' copyright notice, this list of conditions and the following ' disclaimer in the documentation and/or other materials provided ' with the distribution. ' ' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ' "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ' LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ' A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ' OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ' SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ' LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ' DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ' THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ' (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ' OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ' ' ' /////////////////////////////////////////////////////////////////////// ' / MODULE CHANGE LOG / ' /////////////////////////////////////////////////////////////////////// ' ' /////////////////////////////////////////////////////////////////////// ' / MODULE CODE BEGINS BELOW THIS LINE / ' /////////////////////////////////////////////////////////////////////// Private Declare Function ComputerName Lib "kernel32" Alias _ "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long Private Const MAX_COMPUTERNAME_LENGTH = 15 Public Function GetComputerName() As String ' Stolen from ActiveLock 1.89. Author Unknown ' Returns: The name of the computer on the network Dim name As String, maxSize As Long, tmp As Long maxSize = MAX_COMPUTERNAME_LENGTH + 1 name = String(maxSize, 0) tmp = ComputerName(name, maxSize) GetComputerName = name End Function --- NEW FILE: modHDSerial.bas --- Attribute VB_Name = "modHDSerial" ' /////////////////////////////////////////////////////////////////////// ' / Filename: modHDSerial.bas / ' / Version: 2.0.0.1 / ' / Purpose: Gets the serial number of a specified harddrive. / ' / ActiveLock Software Group (ASG) / ' / / ' / Date Created: July 28, 2003 - Dan Sanders / ' / Date Last Modified: / ' / / ' / This software is released under the license detailed below and is / ' / subject to said license. Neither this header nor the licese below / ' / may be removed from this module. / ' /////////////////////////////////////////////////////////////////////// ' ' ' /////////////////////////////////////////////////////////////////////// ' / SOFTWARE LICENSE / ' /////////////////////////////////////////////////////////////////////// ' ' ActiveLock ' Copyright 1998-2002 Nelson Ferraz ' Copyright 2003 The ActiveLock Software Group (ASG) ' All material is the property of the contributing authors. ' ' Redistribution and use in source and binary forms, with or without ' modification, are permitted provided that the following conditions are ' met: ' ' [o] Redistributions of source code must retain the above copyright ' notice, this list of conditions and the following disclaimer. ' ' [o] Redistributions in binary form must reproduce the above ' copyright notice, this list of conditions and the following ' disclaimer in the documentation and/or other materials provided ' with the distribution. ' ' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ' "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ' LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ' A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ' OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ' SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ' LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ' DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ' THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ' (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ' OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ' ' ' /////////////////////////////////////////////////////////////////////// ' / MODULE CHANGE LOG / ' /////////////////////////////////////////////////////////////////////// ' ' /////////////////////////////////////////////////////////////////////// ' / MODULE CODE BEGINS BELOW THIS LINE / ' /////////////////////////////////////////////////////////////////////// Public Declare Function apiGetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" _ (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, _ lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, _ ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long Public Function GetHDSerial(strDriveLetter As String) As String ' Stolen from bjones - ActiveLock 1.89. ' ' Function to return the serial number for a hard drive ' Accepts: ' strDriveLetter - a valid drive letter for the PC, in the format "C:\" ' Returns: ' The serial number for the drive, formatted as "xxxx-xxxx" Dim lngReturn As Long, lngDummy1 As Long, lngDummy2 As Long, lngSerial As Long Dim strDummy1 As String, strDummy2 As String, strSerial As String strDummy1 = Space(260) strDummy2 = Space(260) lngReturn = apiGetVolumeInformation(strDriveLetter, strDummy1, Len(strDummy1), lngSerial, lngDummy1, lngDummy2, strDummy2, Len(strDummy2)) strSerial = Trim(Hex(lngSerial)) strSerial = String(8 - Len(strSerial), "0") & strSerial strSerial = Left(strSerial, 4) & "-" & Right(strSerial, 4) GetHDSerial = strSerial End Function --- NEW FILE: modWindowsSerial.bas --- Attribute VB_Name = "modWindowsSerial" ' /////////////////////////////////////////////////////////////////////// ' / Filename: modWindowsSerial.bas / ' / Version: 2.0.0.1 / ' / Purpose: Gets the serial number of a windows installation. / ' / Sounds like a good method for serial collecting to me! / ' / ActiveLock Software Group (ASG) / ' / / ' / Date Created: July 28, 2003 - Dan Sanders / ' / Date Last Modified: / ' / / ' / This software is released under the license detailed below and is / ' / subject to said license. Neither this header nor the licese below / ' / may be removed from this module. / ' /////////////////////////////////////////////////////////////////////// ' ' ' /////////////////////////////////////////////////////////////////////// ' / SOFTWARE LICENSE / ' /////////////////////////////////////////////////////////////////////// ' ' ActiveLock ' Copyright 1998-2002 Nelson Ferraz ' Copyright 2003 The ActiveLock Software Group (ASG) ' All material is the property of the contributing authors. ' ' Redistribution and use in source and binary forms, with or without ' modification, are permitted provided that the following conditions are ' met: ' ' [o] Redistributions of source code must retain the above copyright ' notice, this list of conditions and the following disclaimer. ' ' [o] Redistributions in binary form must reproduce the above ' copyright notice, this list of conditions and the following ' disclaimer in the documentation and/or other materials provided ' with the distribution. ' ' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ' "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ' LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ' A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ' OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ' SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ' LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ' DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ' THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ' (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ' OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ' ' ' /////////////////////////////////////////////////////////////////////// ' / MODULE CHANGE LOG / ' /////////////////////////////////////////////////////////////////////// ' ' /////////////////////////////////////////////////////////////////////// ' / MODULE CODE BEGINS BELOW THIS LINE / ' /////////////////////////////////////////////////////////////////////// Public Function GetWindowsSerial() As String ' Stolen from bjones - ActiveLock 1.89. ' TODO: Add a beter method for detecting between Win95/98/Me vs NT/2K/XP ' The current implementation is very easy to fool. Not that it really matters. Dim strKey As String strKey = ReadRegVal(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion", "ProductId", "") If strKey = "" Then strKey = ReadRegVal(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductId", "") End If GetWindowsSerial = strKey End Function |
From: Dan <wiz...@us...> - 2003-07-29 21:50:03
|
Update of /cvsroot/activelock/activelock2/src In directory sc8-pr-cvs1:/tmp/cvs-serv8475/src Modified Files: ActiveLock.cls ActiveLock2.dll ActiveLock2.vbp Globals.cls Log Message: Added support for locks other than MAC. Hopefully a new test app will follow shortly. - Dan Index: ActiveLock.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ActiveLock.cls,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ActiveLock.cls 28 Jul 2003 06:35:30 -0000 1.6 +++ ActiveLock.cls 29 Jul 2003 18:49:42 -0000 1.7 @@ -55,7 +55,6 @@ ' / MODULE TO DO LIST / ' /////////////////////////////////////////////////////////////////////// ' -' [ ] Implement IActiveLock_GetLockString() for locktypes other than MAC ' [ ] IActiveLock_Acquire: Check if license has not expired ' [ ] Implement IActiveLock_Release ' [ ] Implement IActiveLock_Transfer @@ -63,8 +62,9 @@ ' / MODULE CHANGE LOG / ' /////////////////////////////////////////////////////////////////////// ' -' 07.07.03 - mcrute - Updated the header comments for this file. -' 07.28.03 - th2tran - Using RSA signature for license key. +' 07.07.03 - mcrute - Updated the header comments for this file. +' 07.28.03 - th2tran - Using RSA signature for license key. +' 07.28.03 - wizzardme2000 - Implemented lockComp, lockHD, and lockWindows ' ' /////////////////////////////////////////////////////////////////////// ' / MODULE CODE BEGINS BELOW THIS LINE / @@ -286,13 +286,13 @@ strLock = strLock & modMACAddress.GetMACAddress() End If If mLockTypes And lockComp Then - ' TODO: strLock = strLock & GetComputerName() + strLock = strLock & modComputerName.GetComputerName() End If If mLockTypes And lockHD Then - ' TODO: strLock = strLock & GetComputerName() + strLock = strLock & modHDSerial.GetHDSerial("C:\") End If If mLockTypes And lockWindows Then - ' TODO: strLock = strLock & GetWindowSerial() + strLock = strLock & modWindowsSerial.GetWindowsSerial() End If If Lic Is Nothing Then IActiveLock_LockCode = strLock Index: ActiveLock2.dll =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ActiveLock2.dll,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsEbKVXy and /tmp/cvsayEYT0 differ Index: ActiveLock2.vbp =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ActiveLock2.vbp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ActiveLock2.vbp 28 Jul 2003 06:35:30 -0000 1.7 +++ ActiveLock2.vbp 29 Jul 2003 18:49:42 -0000 1.8 @@ -1,5 +1,5 @@ Type=OleDll -Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\System32\stdole2.tlb#OLE Automation +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\..\WINNT\System32\stdole2.tlb#OLE Automation Class=ActiveLock; ActiveLock.cls Class=IActiveLock; IActiveLock.cls Class=Globals; Globals.cls @@ -17,6 +17,9 @@ Class=ActiveLockEventNotifier; ActiveLockEventNotifier.cls Module=modActiveLock; modActiveLock.bas Module=modBase64; modBase64.bas +Module=modHDSerial; modHDSerial.bas +Module=modWindowsSerial; modWindowsSerial.bas +Module=modComputerName; modComputerName.bas Startup="(None)" HelpFile="" Title="ActiveLock2" Index: Globals.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/Globals.cls,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Globals.cls 28 Jul 2003 06:35:30 -0000 1.7 +++ Globals.cls 29 Jul 2003 18:49:42 -0000 1.8 @@ -53,7 +53,6 @@ ' / MODULE TO DO LIST / ' /////////////////////////////////////////////////////////////////////// ' -' [ ] GetClassString() - handle the rest of the LockTypes ' [ ] GetLicTypeString() - implement this ' ' /////////////////////////////////////////////////////////////////////// @@ -63,6 +62,7 @@ ' 07.07.03 - mcrute - Updated the header comments for this file. ' 07.21.03 - th2tran - Added ActiveLockErrCodeConstants to contain ' a list of error code constants raised by ActiveLock. +' 07.28.03 - wizzardme2000 - Implemented lockComp, lockHD, and lockWindows ' ' /////////////////////////////////////////////////////////////////////// ' / MODULE CODE BEGINS BELOW THIS LINE / @@ -146,12 +146,17 @@ End Function Private Function GetClassString(LockType As ActiveLock2.ALLockTypes) As String + 'TODO: Decide the class numbers. + ' lockMAC should probably be last, + ' like it is in the enum. (IActivelock.cls) If LockType = lockMAC Then GetClassString = "Class1" ElseIf LockType = lockWindows Then GetClassString = "Class2" - Else - 'TODO: Handle the rest + ElseIf LockType = lockComp Then + GetClassString = "Class3" + ElseIf LockType = lockHD Then + GetClassString = "Class4" End If End Function |
From: Dan <wiz...@us...> - 2003-07-29 21:11:30
|
Update of /cvsroot/activelock/activelock2/src In directory sc8-pr-cvs1:/tmp/cvs-serv13449/src Modified Files: .cvsignore Log Message: Removed alock lib and exp files generated by vb. - Dan Index: .cvsignore =================================================================== RCS file: /cvsroot/activelock/activelock2/src/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .cvsignore 29 Jul 2003 18:58:30 -0000 1.1 +++ .cvsignore 29 Jul 2003 19:04:59 -0000 1.2 @@ -1 +1,3 @@ -ActiveLock2.vbw \ No newline at end of file +ActiveLock2.vbw +ActiveLock2.lib +ActiveLock2.exp \ No newline at end of file |
From: Thanh H. T. <th...@sy...> - 2003-07-29 21:05:12
|
Hi all, Does anyone out there knows how to do this? If so, and code snippet or pointers you can provide will be much appreciated. Thanks in advance. Thanh |
From: Michael E. C. <mc...@us...> - 2003-07-29 19:41:21
|
Update of /cvsroot/activelock/activelock2/src In directory sc8-pr-cvs1:/tmp/cvs-serv10905/activelock2/src Added Files: .cvsignore Log Message: Updated to ignore the .vbw files generated by VB --- NEW FILE: .cvsignore --- ActiveLock2.vbw |
From: Michael E. C. <mc...@us...> - 2003-07-29 19:21:07
|
Update of /cvsroot/activelock/activelock2/test/vbunit In directory sc8-pr-cvs1:/tmp/cvs-serv11625/activelock2/test/vbunit Added Files: .cvsignore Log Message: Updated to ignore the .vbw files generated by VB --- NEW FILE: .cvsignore --- ALTest.vbw |
From: Michael E. C. <mc...@us...> - 2003-07-29 19:00:07
|
Update of /cvsroot/activelock/activelock2/test In directory sc8-pr-cvs1:/tmp/cvs-serv11318/activelock2/test Added Files: .cvsignore Log Message: Updated to ignore the .vbw files generated by VB --- NEW FILE: .cvsignore --- ALTestApp.vbw |
From: Thanh H. T. <th...@sy...> - 2003-07-29 03:17:48
|
Dan, I took liberty of replying to the list because I thought the whole could benefit from our conversation.... Anyway, good job on completing the code. Very much appreciated for your help. I should mention (I thought it goes without saying) that as a developer you are responsible for testing your own code, and a good way of doing it is through the test program. That way, you 1) make sure that your changes doesn't break existing code, and 2) demonstrate to others that your stuff works. I don't expect anyone's code to be bug-free, but on the other hand, I don't want people leaving bugs in the code that are notoriously due to carelessness or lack of testing. I'm no exception. I'd be the first one to kick myself in the behind if I ever do such a thing. No one else is going to go out of their way to unit test our code for us so we must do it ourselves. Sorry, I don't mean to sound harsh, but our code is going to be used by many people all over the world. So we must strive to maintain a professional level of coding ethics throughout, because the end result of that is that you have a high quality, kick-ass piece of code that everyone will admire. :) So Dan, please go ahead and make the appropriate changes in the test app to make it work with your changes. If you need clarification on how the stuff works, please let me know. Regards, Thanh. ----- Original Message ----- From: "Dan" <wiz...@us...> To: <th...@us...> Sent: Monday, July 28, 2003 9:38 PM Subject: Meeting Tonight > Cc: <wiz...@us...> > Message-Id: <E19...@sc...> > Date: Mon, 28 Jul 2003 18:15:48 -0700 > X-EA-Verified: mxrelay.vasoftware.com 19hJ62-0006YT-Gk 554d897e6c5f393c85e2d75c31cca85e > X-Spam-Score: 0.7 > > > [stuffs snipped] Anyway, I thought about my > problem and decided that maybe I don't even have to worry > about it. I finished all of the required code and customizations > within half an hour, debugged and all, and then I want to test > it for real. The code to test it needs heavy modification to be > able to use the changes. I'm thinking that I was never told to > do that, so maybe thats not my job. Anyway, the only real > problem now is that the test app fails to register properly and > always comes back as unregistered when you restart the > program. I am going to assume that there is a MD5 check or > something that is messing it up. I have not spent much time > checking into that yet. |
From: Michael E. C. <mc...@us...> - 2003-07-29 02:09:26
|
Update of /cvsroot/activelock/website In directory sc8-pr-cvs1:/tmp/cvs-serv22063 Log Message: Status: Vendor Tag: tcvs-vendor Release Tags: tcvs-release No conflicts created by this import ***** Bogus filespec: - Imported sources |
From: Thanh H. T. <th...@sy...> - 2003-07-28 17:36:44
|
Dan, I've committed my changes. Go ahead with your implementation. Let me know if you need clarification. Thanks, Thanh. ----- Original Message ----- From: "SourceForge.net" <no...@so...> To: <mc...@so...>; <sou...@fl...>; <act...@li...> Sent: Monday, July 28, 2003 1:31 PM Subject: [ActiveLock2-Devlist][Task #82239] Handle other LockTo Types > Task #82239 has been updated. > > Project: ActiveLock > Subproject: ActiveLock 2.0-alpha1 > Summary: Handle other LockTo Types > Complete: 0% > Status: Open > Authority : mcrute > Assigned to: wizzardme2000 > > Description: Code other LockTo types as specified by comments in Global.cls > > Follow-Ups: > > ------------------------------------------------------- > Date: 2003-07-28 17:31 > By: th2tran > > Comment: > Re-assigning to Dan. > > ------------------------------------------------------- > Date: 2003-07-23 04:16 > By: th2tran > > Comment: > Implement the rest of LockTypes other than lockToMAC. > See TODO list in Globals.cls and ActiveLock.cls > > ------------------------------------------------------- > For more info, visit: > > http://sourceforge.net/pm/task.php?func=detailtask&project_task_id=82239&group_id=70007&group_project_id=25539 > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Activelock-privatedev mailing list > Act...@li... > https://lists.sourceforge.net/lists/listinfo/activelock-privatedev > |
From: Thanh H. T. <th...@us...> - 2003-07-28 06:51:50
|
Update of /cvsroot/activelock/activelock2/src In directory sc8-pr-cvs1:/tmp/cvs-serv6544 Removed Files: ActiveLockAgent.cls LicenseKeyEncoder.cls Log Message: Removed - obsolete --- ActiveLockAgent.cls DELETED --- --- LicenseKeyEncoder.cls DELETED --- |
From: Thanh H. T. <th...@us...> - 2003-07-28 06:40:04
|
Update of /cvsroot/activelock/activelock2/test In directory sc8-pr-cvs1:/tmp/cvs-serv9068 Modified Files: al.lic ALTestApp.vbp frmMain.frm modMain.bas ALCrypto.dll Log Message: Updated to test against new license key generation/registration/validation implementations in ActiveLock2.dll. Index: al.lic =================================================================== RCS file: /cvsroot/activelock/activelock2/test/al.lic,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- al.lic 21 Jul 2003 08:54:38 -0000 1.1 +++ al.lic 28 Jul 2003 06:39:58 -0000 1.2 @@ -9,12 +9,13 @@ Expiration=2003-12-31 LicenseKey=a4849ca280aeb8679b15f6ecac09bbfa [ALTestApp] -ProductCode=AAAAB3NzaC1yc2EAAAABJQAAAIBxElYppptzL+mgXptF/mh5iSraIM19VYnLgTKtStfoFQH1rDEr58XvzWWfkzRVFnb97Njxl3GVXLQo6oEN6uKMZL1pe2Z8ZacBw766AxKeHlFR28RXYvy+BON5YP9Crgdncz/GZkBbDWOx9NXCX9gQRQJFv7s7bsbGZWxMQOzi7Q== ProductVersion=1.0.0 LicenseType=Single LicenseClass=Class1 Licensee=Thanh Tran -LicenseKey=EA3K1xuCr0uE96SJaKgBIAg+LQ844dfuc54qddHhxOp6DDP4ikR0YkwAkNOkoHk91lcoxrvcIecYG1w5Bc7Q1SUWI0lXYc6jSCDXhBRe8vmo7yBfOMrmqePvO2MOvi3JRm0hK9uO+xtWTtLb4HvslSPexOH62oq2Fbo9Nv51WF0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg -RegisteredDate=2003/07/22 -Hash1=c546c2307ce0ca8ec9751948236520a7 -Expiration=2003/08/20 +LicenseKey=AAAAB3NzaC1yc2EAAACAChOALOd+VXMhMAw3OmTjGuV8TMCwtO3ZPnKFqp2WliR8EvmqAJc9XO2DdJFpBglL/1RK9O8G9QQAGaairH8Lh4tG7Wy9L0FVT8Rzi/IlQl+ZNs4bOXLwcYY99AMeoanYdrmdUCS8OGV6EaO2oEHiaIW23FV/m5pT21MEkXbvPns +RegisteredDate=2003/07/28 +Expiration=2003/08/27 +ProductKey=AAAAB3NzaC1yc2EAAAABJQAAAIBZnXD4IKfrBH25ekwLWQMs5mJuNH7D7U99EKFIsVhKQv17GHxKWvxHv/FwWhI1Rmd8TCiqk4Wmk7H1rh6xdbIVBwDj+RSeiXs8mmQX4/XvaWZx9BIQr5wODWnQCH/tj6Y6In2Xjc2J3B7LSjD60cWDBY/u+z9cSheTHLyhb16zFw== +Hash1=b0ffd9956fc8bba60b94dab0c4cc2758 +LastUsed=2003/07/28 02:15:20 Index: ALTestApp.vbp =================================================================== RCS file: /cvsroot/activelock/activelock2/test/ALTestApp.vbp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ALTestApp.vbp 21 Jul 2003 08:54:38 -0000 1.2 +++ ALTestApp.vbp 28 Jul 2003 06:39:58 -0000 1.3 @@ -1,14 +1,12 @@ Type=Exe Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\System32\stdole2.tlb#OLE Automation -Reference=*\A..\src\ActiveLock2.vbp -Form=frmMain.frm +Reference=*\G{AAED8AB4-AC83-4C51-93EE-64664DB96265}#1.0#0#..\src\ActiveLock2.dll#ActiveLock2 Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TABCTL32.OCX +Form=frmMain.frm UserControl=atViewPort.ctl Module=modMain; modMain.bas -Module=modActiveLock; ..\src\modActiveLock.bas ResFile32="atDisplay.RES" -Module=modMACAddress; ..\src\modMACAddress.bas -Module=modBase64; ..\src\modBase64.bas +Module=modActiveLock; ..\src\modActiveLock.bas IconForm="frmMain" Startup="frmMain" HelpFile="" Index: frmMain.frm =================================================================== RCS file: /cvsroot/activelock/activelock2/test/frmMain.frm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- frmMain.frm 23 Jul 2003 03:50:26 -0000 1.3 +++ frmMain.frm 28 Jul 2003 06:39:58 -0000 1.4 @@ -55,9 +55,9 @@ TabCaption(2) = "Test Functionality" TabPicture(2) = "frmMain.frx":0038 Tab(2).ControlEnabled= 0 'False - Tab(2).Control(0)= "Frame1" + Tab(2).Control(0)= "fraTicker" Tab(2).Control(1)= "fraViewport" - Tab(2).Control(2)= "fraTicker" + Tab(2).Control(2)= "Frame1" Tab(2).ControlCount= 3 Begin VB.Frame fraKeyGen Caption = "Key Generator" @@ -284,7 +284,7 @@ TickerFontSize = 11.25 TickerFlash = 0 'False TickerPlaySound = 0 'False - TickerScrollX = 321 + TickerScrollX = 480 BalloonTipIcon = 0 BalloonTipText = "No Messages" End @@ -591,71 +591,34 @@ Private WithEvents ActiveLockEventSink As ActiveLockEventNotifier Attribute ActiveLockEventSink.VB_VarHelpID = -1 -'Private Sub ActiveLockEventSink_Validate(Lic As ProductLicense, Result As Variant) -Private Sub ActiveLockEventSink_ValidateKey(ByVal strLic As String, ByVal strKey As String, Result As Variant) - ' Decrypt LicenseKey using our private key - strKey = modMain.Decrypt(strKey) -Debug.Print "ActiveLockEventSink_Validate key: " & vbCrLf & strKey - Dim strKey2$ -' Dim arrBytes() As Byte -' arrBytes = StrConv(strKey, vbFromUnicode) - strKey2 = TrimNulls(strKey) ' trim nulls - ' Compare for a match against Lic.ToString() - ' If matched return YES; otherwise return NO - If strLic = strKey2 Then - Result = modActiveLock.MAGICNUMBER_YES - Else - Result = modActiveLock.MAGICNUMBER_NO - End If -End Sub +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +' Key Validation Functionalities +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +'Private Sub ActiveLockEventSink_ValidateKey(ByVal strLic As String, Result As Variant) +' ' Decrypt LicenseKey using our private key +' strKey = modMain.Decrypt(strKey) +'Debug.Print "ActiveLockEventSink_Validate key: " & vbCrLf & strKey +' Dim strKey2$ +'' Dim arrBytes() As Byte +'' arrBytes = StrConv(strKey, vbFromUnicode) +' strKey2 = TrimNulls(strKey) ' trim nulls +' ' Compare for a match against Lic.ToString() +' ' If matched return YES; otherwise return NO +' If strLic = strKey2 Then +' Result = modActiveLock.MAGICNUMBER_YES +' Else +' Result = modActiveLock.MAGICNUMBER_NO +' End If +'End Sub Private Sub ActiveLockEventSink_ValidateValue(ByVal Value As String, Result As String) Result = modMain.Encrypt(Value) End Sub -Private Sub cboSpeed_Click() - atViewPort1.TickerSpeed = cboSpeed.ListIndex -End Sub - -Private Sub chkBlackout_Click() - atViewPort1.TickerBlackout = chkBlackout - If chkBlackout Then - atViewPort1.BalloonTipText = "Cannot Display Message In Blackout Mode" - atViewPort1.BalloonTipIcon = WarningIcon - atViewPort1.BalloonTipTitle = "Sorry:" - Else - atViewPort1.BalloonTipText = atViewPort1.TickerText - atViewPort1.BalloonTipIcon = InfoIcon - atViewPort1.BalloonTipTitle = "ActiveTicker Says:" - End If -End Sub - -Private Sub chkEnable_Click() - atViewPort1.BalloonTipEnabled = chkEnable - If chkEnable Then - atViewPort1.BalloonTipIcon = InfoIcon - atViewPort1.BalloonTipTitle = "ActiveTicker Says:" - atViewPort1.BalloonTipText = atViewPort1.TickerText - End If -End Sub - -Private Sub chkFlash_Click() - atViewPort1.TickerFlash = chkFlash -End Sub - -Private Sub chkPause_Click() - atViewPort1.TickerPause = chkPause -End Sub - -Private Sub chkScroll_Click() - atViewPort1.TickerScroll = chkScroll -End Sub - -Private Sub chkSound_Click() - atViewPort1.TickerPlaySound = chkSound -End Sub - - +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +' Key Generator Functionalities +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Private Sub cmbLicClass_Click() If cmbLicClass = "Class 1 - Lock To MAC" Then MyActiveLock.LockType = lockMAC @@ -695,25 +658,44 @@ End With End Sub +'' +' Generate liberation key Private Sub cmdKeyGen_Click() - ' Generate liberation key ' Take request code and decrypt it. Dim strReq As String - strReq = modMain.Decrypt(txtReqCodeIn) + strReq = ActiveLock2.Base64Decode(txtReqCodeIn) ' strReq now contains the {MAC + vbLf + User} string Dim strMAC$, strUser$ GetMACAndUserFromRequestCode strReq, strMAC, strUser - ' encrypt Product license using the MAC Dim strExpire$ strExpire = GetExpirationDate() + + ' registration date + Dim strRegDate As String + strRegDate = Format(Now(), "yyyy/mm/dd") + Dim strEncrypted As String + ActiveLockEventSink_ValidateValue strRegDate, strEncrypted + ' hash it + strEncrypted = ActiveLock2.MD5Hash(strEncrypted) + Dim Lic As ProductLicense Set Lic = ActiveLock2.CreateProductLicense(txtName, txtSoftwareCodePub, _ - txtVersion, MyActiveLock.LockType, MyActiveLock.LicenseType, strUser, strExpire) - Dim strLic As String * 2048 - strLic = MyActiveLock.GetLockString(Lic) - ' encrypt using public key so that only us can decrypt it later - strLic = modMain.Encrypt(strLic) - txtLibKey = strLic + txtVersion, MyActiveLock.LockType, MyActiveLock.LicenseType, strUser, strExpire, , strRegDate, strEncrypted) + Dim strLic As String + ' encrypt Product license using the MAC + strLic = MyActiveLock.LockCode(Lic) + ' sign it + Dim strSig As String + strSig = ActiveLock2.RSASign(PUB_KEY, PRIV_KEY, strLic) + ' Create liberation key. This will be a base-64 encoded string of the whole license. + Dim strLicKey As String + strLicKey = ActiveLock2.Base64Encode(strSig) + ' update Lic with license key + Lic.LicenseKey = strLicKey + ' serialize it into a formatted string + Dim strLibKey As String + Lic.Save strLibKey + txtLibKey = strLibKey End Sub Private Function GetExpirationDate() As String @@ -728,7 +710,7 @@ Dim Index% Index = InStr(1, strReq, vbLf) If Index <= 0 Then Exit Sub - + strMAC = Left(strReq, Index - 1) strUser = Mid$(strReq, Index + 1) strUser = TrimNulls(strUser) @@ -751,13 +733,27 @@ ' return -1 End Function +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +' Key Request and Registration Functionalities +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +Private Sub cmdReqGen_Click() + ' Generate Request code to MAC Address + ' TODO: Handle other possibilities (Windows serial, etc...) + Dim strReq As String, strLock As String + strLock = MyActiveLock.LockCode() + ' combine with user name + strReq = strLock & vbLf & txtUser + ' base-64 encode the request + Dim strReq2 As String + strReq2 = ActiveLock2.Base64Encode(strReq) + txtReqCodeGen = strReq2 +End Sub + Private Sub cmdRegister_Click() On Error GoTo errHandler - ' TODO: Register this key - Dim Lic As ActiveLock2.ProductLicense - Set Lic = ActiveLock2.CreateProductLicense(txtName, txtSoftwareCodePub, txtVersion, _ - MyActiveLock.LockType, MyActiveLock.LicenseType, _ - txtUser, GetExpirationDate(), txtLibKeyIn) + ' Register this key + Dim Lic As New ActiveLock2.ProductLicense + Lic.Load txtLibKey MyActiveLock.Register Lic MsgBox "Registration successful!" Exit Sub @@ -765,16 +761,49 @@ MsgBox Err.Number & ": " & Err.Description End Sub -Private Sub cmdReqGen_Click() - ' Generate Request code to MAC Address - ' TODO: Handle other possibilities (Windows serial, etc...) - Dim strReq As String, strLock As String - strLock = MyActiveLock.GetLockString() - ' combine with user name - strReq = strLock & vbLf & txtUser - ' encrypt using our public key so that only us can decrypt it - strReq = modMain.Encrypt(strReq) - txtReqCodeGen = strReq +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +' The rest of the application's functionalities +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' +Private Sub cboSpeed_Click() + atViewPort1.TickerSpeed = cboSpeed.ListIndex +End Sub + +Private Sub chkBlackout_Click() + atViewPort1.TickerBlackout = chkBlackout + If chkBlackout Then + atViewPort1.BalloonTipText = "Cannot Display Message In Blackout Mode" + atViewPort1.BalloonTipIcon = WarningIcon + atViewPort1.BalloonTipTitle = "Sorry:" + Else + atViewPort1.BalloonTipText = atViewPort1.TickerText + atViewPort1.BalloonTipIcon = InfoIcon + atViewPort1.BalloonTipTitle = "ActiveTicker Says:" + End If +End Sub + +Private Sub chkEnable_Click() + atViewPort1.BalloonTipEnabled = chkEnable + If chkEnable Then + atViewPort1.BalloonTipIcon = InfoIcon + atViewPort1.BalloonTipTitle = "ActiveTicker Says:" + atViewPort1.BalloonTipText = atViewPort1.TickerText + End If +End Sub + +Private Sub chkFlash_Click() + atViewPort1.TickerFlash = chkFlash +End Sub + +Private Sub chkPause_Click() + atViewPort1.TickerPause = chkPause +End Sub + +Private Sub chkScroll_Click() + atViewPort1.TickerScroll = chkScroll +End Sub + +Private Sub chkSound_Click() + atViewPort1.TickerPlaySound = chkSound End Sub Private Sub cmdTest_Click() @@ -789,9 +818,9 @@ Set MyActiveLock = ActiveLock2.NewInstance() MyActiveLock.KeyStoreType = alsFile MyActiveLock.KeyStorePath = App.Path & "\al.lic" - + Set ActiveLockEventSink = MyActiveLock.EventNotifier - + ' Initialize other application settings With atViewPort1 .BalloonTipEnabled = chkEnable @@ -808,13 +837,13 @@ txtSoftwareCodePub = modMain.PUB_KEY cmbLicType = "Periodic" cmbLicClass = "Class 1 - Lock To MAC" - + ' Check registration status On Error GoTo NotRegistered MyActiveLock.Acquire txtRegStatus = "Registered" txtUsedDays = MyActiveLock.UsedDays - txtExpiration = MyActiveLock.RegisteredDate + txtExpiration = MyActiveLock.ExpirationDate FunctionalitiesEnabled = True Exit Sub NotRegistered: Index: modMain.bas =================================================================== RCS file: /cvsroot/activelock/activelock2/test/modMain.bas,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- modMain.bas 21 Jul 2003 08:54:38 -0000 1.2 +++ modMain.bas 28 Jul 2003 06:39:58 -0000 1.3 @@ -205,43 +205,29 @@ ' !!!WARNING!!! ' It is alright to use these same keys for testing your application. But it is highly recommended ' that you generate your own set of keys to use before deploying your app. -Public Const PRIV_KEY$ = "AAAAgExmVeTKhLWc6fa8dsCXI/8XfdGndhZqOoKVkPGhRcZTYjBflth6AkgVKP0eRfRNcv6ZHPZDu3LCGN1gLa91MUkzgvIKmdho6/cz7pMgxQceetp8/qvctjwEmbQm1iUh0DF/J8Y2KEiX4huMUUOv/THCuJSxzfwOWP/WCziTmz1tAAAAQQC72ahbiQC/+VM5XMNu3lcDWuwFIX7xmo+DI3tlfnlovJ9tS0mTk9uH8CvErK/4VMDj2H+PmUl7GcdT0PtIF7vRAAAAQQCaF7cQLP3rrJzXH5e1oAlefgPBe9oWP/6j5sAobM/BVBhePr3erlGF8a9WQCkbXoCdItWj3JuhAFE7OMoJ5ShdAAAAQQCSL6pFfKvlxtVgdSUyB60Z7VYcORBlp8mn3CAixwWJV8GviB0rLPFwqPqARlAo30W93xSvnCmhNt94QYpmh2Oq" -Public Const PUB_KEY$ = "AAAAB3NzaC1yc2EAAAABJQAAAIBxElYppptzL+mgXptF/mh5iSraIM19VYnLgTKtStfoFQH1rDEr58XvzWWfkzRVFnb97Njxl3GVXLQo6oEN6uKMZL1pe2Z8ZacBw766AxKeHlFR28RXYvy+BON5YP9Crgdncz/GZkBbDWOx9NXCX9gQRQJFv7s7bsbGZWxMQOzi7Q==" - -Private mKey As RSAKey -Private mfKeyInitd As Boolean - -Private Function GetCryptKey() As RSAKey - If Not mfKeyInitd Then - modActiveLock.rsa_createkey PUB_KEY, Len(PUB_KEY), PRIV_KEY, Len(PRIV_KEY), mKey - mfKeyInitd = True - End If - GetCryptKey = mKey -End Function +Public Const PRIV_KEY$ = "AAAAgEPRFzhQEF7S91vt2K6kOcEdDDe5BfwNiEL30/+ozTFHc7cZctB8NIlS++ZR//D3AjSMqScjh7xUF/gwvUgGCjiExjj1DF/XWFWnPOCfF8UxYAizCLZ9fdqxb1FRpI5NoW0xxUmvxGjmxKwazIW4P4XVi/+i1Bvh2qQ6ri3whcsNAAAAQQCyWGsbJKO28H2QLYH+enb7ehzwBThqfAeke/Gv1Te95yIAWme71I9aCTTlLsmtIYSk9rNrp3sh9ItD2Re67SE7AAAAQQCAookH1nws1gS2XP9cZTPaZEmFLwuxlSVsLQ5RWmd9cuxpgw5y2gIskbL4c+4oBuj0IDwKtnMrZq7UfV9I5VfVAAAAQQCEnyAuO0ahXH3KhAboop9+tCmRzZInTrDYdMy23xf3PLCLd777dL/Y2Y+zmaH1VO03m6iOog7WLiN4dCL7m+Im" +Public Const PUB_KEY$ = "AAAAB3NzaC1yc2EAAAABJQAAAIBZnXD4IKfrBH25ekwLWQMs5mJuNH7D7U99EKFIsVhKQv17GHxKWvxHv/FwWhI1Rmd8TCiqk4Wmk7H1rh6xdbIVBwDj+RSeiXs8mmQX4/XvaWZx9BIQr5wODWnQCH/tj6Y6In2Xjc2J3B7LSjD60cWDBY/u+z9cSheTHLyhb16zFw==" -'' -' Encrypt using private key. Base64-encode the encrypted data. -' Note that we need to encrypt using our private key, not public -' key because that would be pointless. -' e.g. only we can generate the license key, not any Joe Imposter. -' Public Function Encrypt(strData As String) As String - Dim strData2 As String * 2048 - ' TODO: String * 2048 is a workaround for bug in rsa_decrypt() in ALCrypto.Dll that I don't have time to fix right now. - ' Bug: rsa_decrypt need to account for the possibility of the decrypted string being longer than the encrypted string. - strData2 = strData - ' encrypt using private key. - modActiveLock.rsa_encrypt 1, strData2, Len(strData2), GetCryptKey() - Encrypt = modBase64.Base64_Encode(strData2) -End Function + Dim Key As RSAKey + ' create the key from the key blobs + ' NOTE: I'm being lazy here. We can (and should) use a different keyset for data encryption. + ' PUB_KEY and PRIV_KEY should only used for license key signing and verification. + ' i.e. PRIV_KEY should only be accessible from the Key Generator and only PUB_KEY is + ' available in the deployed application. + ' Also, we can't encrypt using public key because public key is openly visible in the license + ' file and should only be used for verification, not encryption. + modActiveLock.rsa_createkey PUB_KEY, Len(PUB_KEY), PRIV_KEY, Len(PRIV_KEY), Key + ' sign the data using the created key + Dim dLen& + Dim strEnc As String * 255 + strEnc = strData + dLen = Len(strData) + modActiveLock.rsa_encrypt 1, strEnc, dLen, Key + ' done with the key - throw it away + modActiveLock.rsa_freekey Key -'' -' Decrypts using public key. strData is a base64-encoded string of the encrypted data. -Public Function Decrypt(strData As String) As String - Dim strData2 As String * 2048 - ' Base64-decode it first - strData2 = modBase64.Base64_Decode(strData) - ' now decrypt - modActiveLock.rsa_decrypt 0, strData2, GetCryptKey() - Decrypt = strData2 + Dim strOut As String + strOut = Left$(strEnc, dLen) + Encrypt = strOut End Function Index: ALCrypto.dll =================================================================== RCS file: /cvsroot/activelock/activelock2/test/ALCrypto.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsgt8P8e and /tmp/cvsMnl7Tl differ |
From: Thanh H. T. <th...@us...> - 2003-07-28 06:36:45
|
Update of /cvsroot/activelock/activelock2/test In directory sc8-pr-cvs1:/tmp/cvs-serv8618 Removed Files: ActiveLockClientAgent.cls Log Message: Removed - obsolete --- ActiveLockClientAgent.cls DELETED --- |
From: Thanh H. T. <th...@us...> - 2003-07-28 06:35:36
|
Update of /cvsroot/activelock/activelock2/src In directory sc8-pr-cvs1:/tmp/cvs-serv8456 Modified Files: ActiveLock.cls ActiveLock2.vbp ActiveLockEventNotifier.cls FileKeyStore.cls Globals.cls IActiveLock.cls modActiveLock.bas ProductLicense.cls ActiveLock2.dll ALCrypto.dll Log Message: In this update, I'm introducing RSA signature technology into the mix. RSA signature will be be used for generating license keys. The process of key generation will be equivalent to signing a particular license with a product's private key. Presumably, this private key resides only on the machine containing the key generator (inside a database or something). They can't hack it if it's not there, right? The deployed application will have access to a public key that it will used to verify the license key (the signature). (This is otherwise known to AL 1.x user as the SoftwareCode, although you see I've changed its semantics a little bit.) Oh, and I also fixed the problem where extraneous characters are generated at the end of the liberation key. Index: ActiveLock.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ActiveLock.cls,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ActiveLock.cls 23 Jul 2003 03:53:43 -0000 1.5 +++ ActiveLock.cls 28 Jul 2003 06:35:30 -0000 1.6 @@ -63,8 +63,8 @@ ' / MODULE CHANGE LOG / ' /////////////////////////////////////////////////////////////////////// ' -' 07.07.03 - mcrute - Updated the header comments for this file. -' +' 07.07.03 - mcrute - Updated the header comments for this file. +' 07.28.03 - th2tran - Using RSA signature for license key. ' ' /////////////////////////////////////////////////////////////////////// ' / MODULE CODE BEGINS BELOW THIS LINE / @@ -97,28 +97,6 @@ Set IActiveLock_EventNotifier = MyNotifier End Property -Private Function IActiveLock_GetLockString(Optional Lic As ProductLicense = Nothing) As String - Dim strLock As String - - If (mLockTypes And lockMAC) = lockMAC Then - strLock = strLock & modMACAddress.GetMACAddress() - End If - If mLockTypes And lockComp Then - ' TODO: strLock = strLock & GetComputerName() - End If - If mLockTypes And lockHD Then - ' TODO: strLock = strLock & GetComputerName() - End If - If mLockTypes And lockWindows Then - ' TODO: strLock = strLock & GetWindowSerial() - End If - If Lic Is Nothing Then - IActiveLock_GetLockString = strLock - Else - IActiveLock_GetLockString = Lic.ToString() & vbCrLf & strLock - End If -End Function - Private Sub IActiveLock_Init(Arg1 As Variant, ParamArray OtherArgs() As Variant) ' Do nothing. No extra initialization needed for now. End Sub @@ -133,13 +111,8 @@ If Lic Is Nothing Then Err.Raise ActiveLockErrCodeConstants.alerrNoLicense, "IActiveLock_Acquire", "No valid license" End If - Dim varResult As Variant - MyNotifier.Notify "ValidateKey", IActiveLock_GetLockString(Lic), Lic.LicenseKey, varResult - ' Check varResult for an affirmative - If CLng(varResult) <> modActiveLock.MAGICNUMBER_YES Then - Err.Raise ActiveLockErrCodeConstants.alerrLicenseInvalid, "IActiveLock_RegisteredDate", "License invalid." - End If - ' TODO: Check if license has not expired + ' Validate license + ValidateLic Lic End Sub Private Property Get IActiveLock_RegisteredDate() As String @@ -149,14 +122,83 @@ Err.Raise ActiveLockErrCodeConstants.alerrNoLicense, "IActiveLock_RegisteredDate", "No license." End If ' Validate the License. - Dim varResult As Variant - MyNotifier.Notify "ValidateKey", IActiveLock_GetLockString(Lic), Lic.LicenseKey, varResult - If CLng(varResult) <> modActiveLock.MAGICNUMBER_YES Then - Err.Raise ActiveLockErrCodeConstants.alerrLicenseInvalid, "IActiveLock_RegisteredDate", "License invalid." - End If + ValidateLic Lic IActiveLock_RegisteredDate = Lic.RegisteredDate End Property +'' +' Validate the License Key using RSA signature verification. +' License key contains the RSA signature of IActiveLock_LockCode. +Private Sub ValidateKey(Lic As ProductLicense) + Dim Key As RSAKey + Dim strPubKey As String + strPubKey = mSoftwareCode + Dim strSig As String + Dim strLic As String + strLic = IActiveLock_LockCode(Lic) + ' decode the license key + strSig = MyGlobals.Base64Decode(Lic.LicenseKey) + ' validate the key + Dim rc& + rc = MyGlobals.RSAVerify(strPubKey, strLic, strSig) + If rc <> 0 Then + Err.Raise ActiveLockErrCodeConstants.alerrLicenseInvalid, "ActiveLock2", "License invalid." + End If + ' Check if license has not expired + Dim dtExp As Date + dtExp = CDate(Lic.Expiration) + If Now > dtExp Then + Err.Raise ActiveLockErrCodeConstants.alerrLicenseExpired, "ActiveLock2", "License expired" + End If +End Sub + +'' +' Validate the entire license (including lastused, etc...) +' +Private Sub ValidateLic(Lic As ProductLicense) + ' validate license key first + ValidateKey Lic + Dim strEncrypted As String, strHash As String + ' Validate last run date + MyNotifier.Notify "ValidateValue", Lic.LastUsed, strEncrypted + strHash = MyGlobals.MD5Hash(strEncrypted) + If strHash <> Lic.Hash1 Then + Err.Raise ActiveLockErrCodeConstants.alerrLicenseTampered, "ActiveLock2", "License may have been tampered." + End If + ' try to detect the user setting their system clock back + If Now < CDate(Lic.LastUsed) Then + ' TODO: Need to account for Daylight Savings Time + Err.Raise ActiveLockErrCodeConstants.alerrLockChanged, "ActiveLock2", "License invalid. You have set your system clock backward!" + End If + UpdateLastUsed Lic + mKeyStore.Store Lic +End Sub + +'' +' Updates LastUsed property with current date stamp. +' +Private Sub UpdateLastUsed(Lic As ProductLicense) + ' Update license store with LastRunDate + Dim strEncrypted As String + Dim strLastUsed As String + strLastUsed = Format(Now(), "YYYY/MM/DD HH:MM:SS") + Lic.LastUsed = strLastUsed + MyNotifier.Notify "ValidateValue", strLastUsed, strEncrypted + Lic.Hash1 = MyGlobals.MD5Hash(strEncrypted) +End Sub + +Private Property Get IActiveLock_ExpirationDate() As String + Dim Lic As ProductLicense + Set Lic = mKeyStore.Retrieve(mSoftwareName) + If Lic Is Nothing Then + Err.Raise ActiveLockErrCodeConstants.alerrNoLicense, "IActiveLock_ExpirationDate", "No license." + End If + ' Validate the License. + ValidateLic Lic + IActiveLock_ExpirationDate = Lic.Expiration +End Property + + Private Sub IActiveLock_Release() ' TODO: Implement Me! End Sub @@ -197,24 +239,24 @@ Private Sub IActiveLock_Register(Lic As ProductLicense) - ' Validate that the liberation key contains the combination of these properties + ' Validate that the license key. ' - registered user ' - expiry date Dim varResult As Variant - MyNotifier.Notify "ValidateKey", IActiveLock_GetLockString(Lic), Lic.LicenseKey, varResult - If CLng(varResult) <> modActiveLock.MAGICNUMBER_YES Then - Err.Raise ActiveLockErrCodeConstants.alerrLicenseInvalid, "IActiveLock_Register", "License invalid." - End If + ValidateKey Lic ' License was validated successfuly. Store it. If mKeyStore Is Nothing Then Err.Raise ActiveLockErrCodeConstants.alerrKeyStoreInvalid, "IActiveLock_Register", "Key Store Provider hasn't been initialized yet." End If - ' obtain encrypted value for the RegisteredDate - Lic.RegisteredDate = Format(Now(), "yyyy/mm/dd") - Dim strEncrypted As String - MyNotifier.Notify "ValidateValue", Lic.RegisteredDate, strEncrypted - ' hash it - Lic.Hash1 = modMD5.Hash(strEncrypted) +' ' obtain encrypted value for the RegisteredDate +' Lic.RegisteredDate = Format(Now(), "yyyy/mm/dd") +' Dim strEncrypted As String +' MyNotifier.Notify "ValidateValue", Lic.RegisteredDate, strEncrypted +' ' hash it +' Lic.Hash1 = modMD5.Hash(strEncrypted) + + ' Update last used date + UpdateLastUsed Lic mKeyStore.Store Lic End Sub @@ -237,6 +279,27 @@ IActiveLock_SoftwareName = mSoftwareName End Property +Private Function IActiveLock_LockCode(Optional Lic As ProductLicense = Nothing) As String + Dim strLock As String + + If (mLockTypes And lockMAC) = lockMAC Then + strLock = strLock & modMACAddress.GetMACAddress() + End If + If mLockTypes And lockComp Then + ' TODO: strLock = strLock & GetComputerName() + End If + If mLockTypes And lockHD Then + ' TODO: strLock = strLock & GetComputerName() + End If + If mLockTypes And lockWindows Then + ' TODO: strLock = strLock & GetWindowSerial() + End If + If Lic Is Nothing Then + IActiveLock_LockCode = strLock + Else + IActiveLock_LockCode = Lic.ToString() & vbCrLf & strLock + End If +End Function Private Property Let IActiveLock_SoftwareVersion(RHS As String) mSoftwareVer = RHS @@ -245,11 +308,12 @@ IActiveLock_SoftwareVersion = mSoftwareVer End Property - Private Property Let IActiveLock_SoftwareCode(RHS As String) + ' SoftwareCode is an RSA public key. This code will be used to verify license keys later on. mSoftwareCode = RHS End Property + Private Function IActiveLock_Transfer(OtherSoftwareCode As String) As String ' TODO: Implement me! End Function @@ -257,14 +321,7 @@ Private Property Get IActiveLock_UsedDays() As Long Dim Lic As ProductLicense Set Lic = mKeyStore.Retrieve(mSoftwareName) - Dim Result As String - MyNotifier.Notify "ValidateValue", Lic.RegisteredDate, Result - ' Hash Result and compare against Lic.RegisteredDate - Dim strHash$ - strHash = modMD5.Hash(Result) - - If strHash <> Lic.Hash1 Then - Err.Raise ActiveLockErrCodeConstants.alerrLicenseTampered, "IActiveLock", "License may have been tampered." - End If + ' validate the license + ValidateLic Lic IActiveLock_UsedDays = CLng(DateDiff("d", Lic.RegisteredDate, Now)) End Property Index: ActiveLock2.vbp =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ActiveLock2.vbp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ActiveLock2.vbp 23 Jul 2003 02:55:33 -0000 1.6 +++ ActiveLock2.vbp 28 Jul 2003 06:35:30 -0000 1.7 @@ -1,6 +1,5 @@ Type=OleDll Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\System32\stdole2.tlb#OLE Automation -Reference=*\G{420B2830-E718-11CF-893D-00A0C9054228}#1.0#0#C:\WINDOWS\System32\scrrun.dll#Microsoft Scripting Runtime Class=ActiveLock; ActiveLock.cls Class=IActiveLock; IActiveLock.cls Class=Globals; Globals.cls @@ -17,6 +16,7 @@ Module=modWinApi; modWinApi.bas Class=ActiveLockEventNotifier; ActiveLockEventNotifier.cls Module=modActiveLock; modActiveLock.bas +Module=modBase64; modBase64.bas Startup="(None)" HelpFile="" Title="ActiveLock2" @@ -25,6 +25,7 @@ Name="ActiveLock2" HelpContextID="0" CompatibleMode="1" +CompatibleEXE32="ActiveLock2.dll" MajorVer=2 MinorVer=0 RevisionVer=0 Index: ActiveLockEventNotifier.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ActiveLockEventNotifier.cls,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ActiveLockEventNotifier.cls 23 Jul 2003 06:41:26 -0000 1.2 +++ ActiveLockEventNotifier.cls 28 Jul 2003 06:35:30 -0000 1.3 @@ -73,12 +73,6 @@ Option Explicit '' -' License Key Validation event. -' @param strLic String returned from ProductLicense.ToString() -' @param strKey License key. -' @param varResult Result value. -Public Event ValidateKey(ByVal strLic As String, ByVal strKey As String, varResult As Variant) -'' ' ProductLicense Property Value validation event allows the client application ' to return the encrypted version of a license property value. ' @param Value Property value. @@ -86,9 +80,7 @@ Public Event ValidateValue(ByVal Value As String, Result As String) Friend Sub Notify(EventName As String, ParamArray Args()) - If EventName = "ValidateKey" Then - RaiseEvent ValidateKey(CStr(Args(0)), CStr(Args(1)), Args(2)) - ElseIf EventName = "ValidateValue" Then + If EventName = "ValidateValue" Then Dim Result As String Result = Args(1) RaiseEvent ValidateValue(CStr(Args(0)), Result) Index: FileKeyStore.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/FileKeyStore.cls,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- FileKeyStore.cls 23 Jul 2003 03:55:21 -0000 1.5 +++ FileKeyStore.cls 28 Jul 2003 06:35:30 -0000 1.6 @@ -77,7 +77,7 @@ Private mIniFile As New INIFile ' License File Key names -Private Const KEY_PRODKEY$ = "ProductCode" +Private Const KEY_PRODKEY$ = "ProductKey" Private Const KEY_PRODNAME$ = "ProductName" Private Const KEY_PRODVER$ = "ProductVersion" Private Const KEY_LICENSEE$ = "Licensee" @@ -86,7 +86,8 @@ Private Const KEY_LICKEY$ = "LicenseKey" Private Const KEY_EXP$ = "Expiration" Private Const KEY_REGISTERED_DATE$ = "RegisteredDate" -Private Const KEY_REGISTERED_DATE_HASH$ = "Hash1" +Private Const KEY_LASTRUN_DATE$ = "LastUsed" ' date and time stamp +Private Const KEY_LASTRUN_DATE_HASH$ = "Hash1" ' Hash of LastRunDate Private Property Let IKeyStoreProvider_KeyStorePath(RHS As String) If Not FileExists(RHS) Then @@ -108,7 +109,8 @@ mIniFile.Values(KEY_LICENSEE) = .Licensee mIniFile.Values(KEY_LICKEY) = .LicenseKey mIniFile.Values(KEY_REGISTERED_DATE) = .RegisteredDate - mIniFile.Values(KEY_REGISTERED_DATE_HASH) = .Hash1 + mIniFile.Values(KEY_LASTRUN_DATE) = .LastUsed + mIniFile.Values(KEY_LASTRUN_DATE_HASH) = .Hash1 mIniFile.Values(KEY_EXP) = .Expiration End With @@ -120,6 +122,7 @@ Private Function IKeyStoreProvider_Retrieve(ProductName As String) As ProductLicense Dim Lic As New ProductLicense ' Read license properties from INI file section + ' TODO: Perhaps we need to lock the file first.? mIniFile.Section = ProductName With Lic .ProductName = ProductName @@ -131,7 +134,8 @@ .LicenseKey = mIniFile.GetValue(KEY_LICKEY) .Expiration = mIniFile.GetValue(KEY_EXP) .RegisteredDate = mIniFile.Values(KEY_REGISTERED_DATE) - .Hash1 = mIniFile.Values(KEY_REGISTERED_DATE_HASH) + .LastUsed = mIniFile.Values(KEY_LASTRUN_DATE) + .Hash1 = mIniFile.Values(KEY_LASTRUN_DATE_HASH) End With Set IKeyStoreProvider_Retrieve = Lic End Function Index: Globals.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/Globals.cls,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Globals.cls 23 Jul 2003 07:04:08 -0000 1.6 +++ Globals.cls 28 Jul 2003 06:35:30 -0000 1.7 @@ -92,6 +92,7 @@ alerrLicenseInvalid = &H80040002 alerrLicenseExpired = &H80040003 alerrLicenseTampered = &H80040004 + alerrLockChanged = &H80040005 alerrKeyStoreInvalid = &H80040010 End Enum @@ -134,6 +135,12 @@ If Not IsMissing(LicKey) Then .LicenseKey = LicKey End If + If Not IsMissing(RegisteredDate) Then + .RegisteredDate = RegisteredDate + End If + If Not IsMissing(Hash1) Then + .Hash1 = Hash1 + End If End With Set CreateProductLicense = NewLic End Function @@ -154,4 +161,63 @@ Private Function GetLicTypeString(LicType As ALLicType) As String 'TODO: Implement this properly. GetLicTypeString = "Single" +End Function + +'' +' Trim Null characters from the string. +' +Public Function TrimNulls(str As String) As String + TrimNulls = modActiveLock.TrimNulls(str) +End Function +'' +' Computes an MD5 hash of the specified string. +' +Public Function MD5Hash(str As String) As String + MD5Hash = modMD5.Hash(str) +End Function + +'' +' Base-64 encode the specified string. +' +Public Function Base64Encode(str As String) As String + Base64Encode = modBase64.Base64_Encode(str) +End Function + +'' +' Base-64 decode the string. +' +Public Function Base64Decode(strEncoded As String) As String + Base64Decode = modBase64.Base64_Decode(strEncoded) +End Function + +'' +' Performs RSA signing of strData using the specified key. +' +Public Function RSASign(strPub As String, strPriv As String, strdata As String) As String + Dim Key As RSAKey + ' create the key from the key blobs + modActiveLock.rsa_createkey strPub, Len(strPub), strPriv, Len(strPriv), Key + ' sign the data using the created key + Dim sLen& + rsa_sign Key, strdata, Len(strdata), vbNullString, sLen + Dim strSig As String: strSig = String(sLen, 0) + modActiveLock.rsa_sign Key, strdata, Len(strdata), strSig, sLen + ' throw away the key + modActiveLock.rsa_freekey Key + RSASign = strSig +End Function + +'' +' Verifies an RSA signature. +' +Public Function RSAVerify(strPub As String, strdata As String, strSig As String) As Long + Dim Key As RSAKey + Dim rc& + ' create the key from the public key blob + rsa_createkey strPub, Len(strPub), vbNullString, 0, Key + ' validate the key + rc = rsa_verifysig(Key, strSig, Len(strSig), strdata, Len(strdata)) + ' de-allocate memory used by the key + rsa_freekey Key + RSAVerify = rc End Function Index: IActiveLock.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/IActiveLock.cls,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- IActiveLock.cls 23 Jul 2003 03:53:43 -0000 1.5 +++ IActiveLock.cls 28 Jul 2003 06:35:30 -0000 1.6 @@ -8,7 +8,7 @@ END Attribute VB_Name = "IActiveLock" Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = True +Attribute VB_Creatable = False Attribute VB_PredeclaredId = False Attribute VB_Exposed = True '* ActiveLock @@ -127,7 +127,7 @@ ' @param Args '* [th2tran20030720] I can't think of any special initialization that is required right now. ' But let's keep this for future use. -Public Sub Init(Arg1 As Variant, ParamArray OtherArgs()) +Public Sub Init(Arg1 As Variant, ParamArray OtherArgs() As Variant) End Sub @@ -165,6 +165,12 @@ End Property +'' +' Specifies the software code (product code) +' +Public Property Let SoftwareCode(sCode As String) + +End Property '' ' Specifies the version of the product being locked. @@ -179,9 +185,9 @@ '' ' Specifies the product code for the product being locked. ' -Public Property Let SoftwareCode(sCode As String) - -End Property +'Public Property Get SoftwareCode(sCode As String) +' +'End Property '' ' Specifies the key store type. @@ -202,10 +208,9 @@ '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '' -' Returns the lock string corresponding to the set LockType. +' Returns the software code corresponding to the set LockTypes, license class, etc... ' Optionally, if a product license is specified, then a lock string specific to that license is returned. -' -Public Function GetLockString(Optional Lic As ProductLicense = Nothing) As String +Public Function LockCode(Optional Lic As ProductLicense = Nothing) As String End Function @@ -259,5 +264,12 @@ ' Returns the date on which the product was registered. ' Public Property Get RegisteredDate() As String + +End Property + +'' +' Returns the expiration date +' +Public Property Get ExpirationDate() As String End Property Index: modActiveLock.bas =================================================================== RCS file: /cvsroot/activelock/activelock2/src/modActiveLock.bas,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- modActiveLock.bas 21 Jul 2003 08:48:27 -0000 1.4 +++ modActiveLock.bas 28 Jul 2003 06:35:30 -0000 1.5 @@ -69,7 +69,7 @@ ' q As Integer ' iqmp As Integer ' comment As String - Data(32) As Byte + data(32) As Byte End Type '' @@ -78,10 +78,13 @@ Public Declare Function rsa_public_key_blob Lib "ALCrypto" (ptrKey As RSAKey, ByVal blob As String, blobLen As Long) As Long Public Declare Function rsa_private_key_blob Lib "ALCrypto" (ptrKey As RSAKey, ByVal blob As String, blobLen As Long) As Long Public Declare Function rsa_createkey Lib "ALCrypto" (ByVal pub_blob As String, ByVal pub_len As Long, ByVal priv_blob As String, ByVal priv_len As Long, ptrKey As RSAKey) As Long +Public Declare Function rsa_freekey Lib "ALCrypto" (ptrKey As RSAKey) As Long ' CryptType = 0 for public; 1 for private -Public Declare Function rsa_encrypt Lib "ALCrypto" (ByVal CryptType As Long, ByVal Data As String, ByVal dLen As Long, ptrKey As RSAKey) As Long -Public Declare Function rsa_decrypt Lib "ALCrypto" (ByVal CryptType As Long, ByVal Data As String, ptrKey As RSAKey) As Long +Public Declare Function rsa_encrypt Lib "ALCrypto" (ByVal CryptType As Long, ByVal data As String, dLen As Long, ptrKey As RSAKey) As Long +Public Declare Function rsa_decrypt Lib "ALCrypto" (ByVal CryptType As Long, ByVal data As String, dLen As Long, ptrKey As RSAKey) As Long +Public Declare Function rsa_sign Lib "ALCrypto" (ByRef ptrKey As RSAKey, ByVal data As String, ByVal dLen As Long, ByVal sig As String, ByRef sLen As Long) As Long +Public Declare Function rsa_verifysig Lib "ALCrypto" (ByRef ptrKey As RSAKey, ByVal sig As String, ByVal sLen As Long, ByVal data As String, ByVal dLen As Long) As Long Type PhaseType exponential As Byte startpoint As Byte Index: ProductLicense.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ProductLicense.cls,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ProductLicense.cls 21 Jul 2003 08:48:27 -0000 1.3 +++ ProductLicense.cls 28 Jul 2003 06:35:30 -0000 1.4 @@ -8,7 +8,7 @@ END Attribute VB_Name = "ProductLicense" Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False +Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True '* ActiveLock @@ -79,6 +79,8 @@ Private mstrLicenseKey As String Private mstrExpiration As String Private mstrRegisteredDate As String +Private mstrLastUsed As String + Private mstrHash1 As String ' hash of mstrRegisteredDate ' CPU License Class - I don't yet know how this could be done! @@ -91,8 +93,8 @@ CLASS_2 = "Class2" End Property -Friend Property Let ProductName(Name As String) - mstrProductName = Name +Friend Property Let ProductName(name As String) + mstrProductName = name End Property Public Property Get ProductName() As String ProductName = mstrProductName @@ -105,7 +107,11 @@ ProductVer = mstrProductVer End Property -Friend Property Let ProductKey(Key As String) +'' +' !!!WARNING!!! Use this method with caution. You run the risk of invalidating your existing license +' if you call this method without knowing what you are doing. +' +Public Property Let ProductKey(Key As String) mstrProductKey = Key End Property Public Property Get ProductKey() As String @@ -126,14 +132,19 @@ LicenseClass = mstrLicenseClass End Property -Friend Property Let Licensee(Name As String) - mstrLicensee = Name +Friend Property Let Licensee(name As String) + mstrLicensee = name End Property Public Property Get Licensee() As String Licensee = mstrLicensee End Property -Friend Property Let LicenseKey(Key As String) +'' +' Updates the License Key. +' !!! WARNING !!! Make sure you know what you're doing when you call this method; otherwise, you run +' the risk of invalidating your existing license. +' +Public Property Let LicenseKey(Key As String) mstrLicenseKey = Key End Property @@ -164,6 +175,16 @@ End Property '' +' Returns the last date and time the product was run. +' +Public Property Get LastUsed() As String + LastUsed = mstrLastUsed +End Property +Friend Property Let LastUsed(strDateTime As String) + mstrLastUsed = strDateTime +End Property + +'' ' Returns Hash-1 code. ' Public Property Get Hash1() As String @@ -179,11 +200,39 @@ ' Note: LicenseKey is not included in this string. ' Public Function ToString() As String -' ToString = ProductID & vbCrLf & ToString = ProductName & vbCrLf & _ ProductVer & vbCrLf & _ + ProductKey & vbCrLf & _ LicenseClass & vbCrLf & _ LicenseType & vbCrLf & _ Licensee & vbCrLf & _ + RegisteredDate & vbCrLf & _ Expiration End Function + +'' +' Loads the license from a formatted string. +' +Public Sub Load(strLic As String) + ' First, base64-decode it + strLic = modBase64.Base64_Decode(strLic) + Dim arrParts() As String + arrParts = Split(strLic, vbCrLf) + ProductName = arrParts(0) + ProductVer = arrParts(1) + ProductKey = arrParts(2) + LicenseClass = arrParts(3) + LicenseType = arrParts(4) + Licensee = arrParts(5) + RegisteredDate = arrParts(6) + Expiration = arrParts(7) + LicenseKey = arrParts(8) +End Sub + +'' +' Saves the license into a formatted string. +' +Public Sub Save(strOut As String) + strOut = ToString() & vbCrLf & LicenseKey 'add License Key at the end + strOut = modBase64.Base64_Encode(strOut) +End Sub Index: ActiveLock2.dll =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ActiveLock2.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsRWmBj9 and /tmp/cvsCnzov9 differ Index: ALCrypto.dll =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ALCrypto.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsg9YVcd and /tmp/cvsgB6cZh differ |
From: Thanh H. T. <th...@us...> - 2003-07-28 01:06:51
|
Update of /cvsroot/activelock/alcrypto/test In directory sc8-pr-cvs1:/tmp/cvs-serv28956 Added Files: Form1.frm Module1.bas Project1.vbp Log Message: Test program for ALCrypto.Dll --- NEW FILE: Form1.frm --- VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 4305 ClientLeft = 60 ClientTop = 345 ClientWidth = 7185 LinkTopic = "Form1" ScaleHeight = 4305 ScaleWidth = 7185 StartUpPosition = 3 'Windows Default Begin VB.TextBox txtSig Height = 855 Left = 1080 MultiLine = -1 'True TabIndex = 18 Top = 3120 Width = 4215 End Begin VB.CommandButton cmdVerify Caption = "&Verify" Height = 375 Left = 5640 TabIndex = 17 Top = 3360 Width = 1455 End Begin VB.CommandButton cmdSign Caption = "&Sign" Height = 375 Left = 5640 TabIndex = 15 Top = 3000 Width = 1455 End Begin VB.CommandButton cmdPubDec Caption = "Public Dencryp&t" Height = 375 Left = 5640 TabIndex = 14 Top = 2040 Width = 1455 End Begin VB.CommandButton cmdPrivEnc Caption = "&Private Encrypt" Height = 375 Left = 5640 TabIndex = 13 Top = 1680 Width = 1455 End Begin VB.CommandButton cmdDecrypt Caption = "Private &Decrypt" Height = 375 Left = 5640 TabIndex = 12 Top = 1320 Width = 1455 End Begin VB.CommandButton cmdEncrypt Caption = "Public &Encrypt" Height = 375 Left = 5640 TabIndex = 11 Top = 960 Width = 1455 End Begin VB.TextBox txtDecrypted Height = 615 Left = 1080 TabIndex = 10 Top = 2400 Width = 4215 End Begin VB.TextBox txtEncrypted Height = 615 Left = 1080 TabIndex = 8 Top = 1680 Width = 4215 End Begin VB.TextBox txtData Height = 615 Left = 1080 TabIndex = 6 Text = "Text1" Top = 960 Width = 4215 End Begin VB.CommandButton cmdGen Caption = "&Generate" Height = 375 Left = 5640 TabIndex = 4 Top = 120 Width = 1455 End Begin VB.TextBox txtPub Height = 375 Left = 1080 TabIndex = 3 Top = 480 Width = 4215 End Begin VB.TextBox txtPriv Height = 375 Left = 1080 TabIndex = 1 Top = 120 Width = 4215 End Begin VB.Label Label6 Caption = "Signature:" Height = 375 Left = 0 TabIndex = 16 Top = 3000 Width = 1095 End Begin VB.Label Label5 Caption = "Decrypted:" Height = 375 Left = 0 TabIndex = 9 Top = 2520 Width = 1095 End Begin VB.Label Label4 Caption = "Encrypted:" Height = 375 Left = 0 TabIndex = 7 Top = 1800 Width = 1095 End Begin VB.Label Label3 Caption = "Text:" Height = 375 Left = 0 TabIndex = 5 Top = 1080 Width = 1095 End Begin VB.Label Label2 Caption = "Public Key:" Height = 375 Left = 0 TabIndex = 2 Top = 480 Width = 1215 End Begin VB.Label Label1 Caption = "Private Key:" Height = 375 Left = 0 TabIndex = 0 Top = 120 Width = 1215 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim mstrEncrypted As String * 128 Private Sub cmdDecrypt_Click() Decrypt 1 End Sub Private Sub Decrypt(CryptType As Long) Screen.MousePointer = vbHourglass Dim key As RSAKey rsa_createkey txtPub, Len(txtPub), txtPriv, Len(txtPriv), key Dim strData As String * 128 strData = mstrEncrypted Dim nLen& nLen = Len(strData) rsa_decrypt CryptType, strData, nLen, key txtDecrypted = strData Screen.MousePointer = vbDefault End Sub Private Sub cmdEncrypt_Click() Encrypt 0 End Sub Private Sub Encrypt(CryptType As Long) Screen.MousePointer = vbHourglass Dim key As RSAKey rsa_createkey txtPub, Len(txtPub), txtPriv, Len(txtPriv), key mstrEncrypted = txtData Dim nLen& nLen = Len(txtData) rsa_encrypt CryptType, mstrEncrypted, nLen, key txtEncrypted = mstrEncrypted Screen.MousePointer = vbDefault End Sub Private Sub cmdPrivEnc_Click() Encrypt 1 End Sub Private Sub cmdPubDec_Click() Decrypt 0 End Sub Private Sub cmdGen_Click() Screen.MousePointer = vbHourglass Dim key As RSAKey Dim prog As ProgressType rsa_generate key, 1024, AddressOf ProgressUpdate, VarPtr(prog) Dim strBlob As String Dim blobLen As Long rsa_public_key_blob key, vbNullString, blobLen If blobLen > 0 Then strBlob = String(blobLen, 0) rsa_public_key_blob key, strBlob, blobLen Debug.Print "Public blob: " & strBlob txtPub = strBlob End If rsa_private_key_blob key, vbNullString, blobLen If blobLen > 0 Then strBlob = String(blobLen, 0) rsa_private_key_blob key, strBlob, blobLen Debug.Print "Private blob: " & strBlob txtPriv = strBlob End If Screen.MousePointer = vbDefault End Sub Private Sub cmdSign_Click() Screen.MousePointer = vbHourglass Dim key As RSAKey rsa_createkey txtPub, Len(txtPub), txtPriv, Len(txtPriv), key Dim nLen&, sLen& nLen = Len(txtData) rsa_sign key, txtData, nLen, vbNullString, sLen Dim strSig As String strSig = String(sLen, 0) rsa_sign key, txtData, nLen, strSig, sLen txtSig = modBase64.Base64_Encode(strSig) Screen.MousePointer = vbDefault End Sub Private Sub cmdVerify_Click() Screen.MousePointer = vbHourglass Dim key As RSAKey Dim strSig As String strSig = modBase64.Base64_Decode(txtSig) rsa_createkey txtPub, Len(txtPub), txtPriv, Len(txtPriv), key If rsa_verifysig(key, strSig, Len(strSig), txtData, Len(txtData)) = 0 Then MsgBox "Signature verification passed!" Else MsgBox "Signature verification failed!" End If Screen.MousePointer = vbDefault End Sub --- NEW FILE: Module1.bas --- Attribute VB_Name = "Module1" Option Explicit Option Base 0 Type RSAKey ' 36-byte structure bits As Long ' bytes As Long ' modulus As Integer ' exponent As Integer ' private_exponent As Integer ' p As Integer ' q As Integer ' iqmp As Integer ' comment As String data(32) As Byte End Type Public Declare Function rsa_generate Lib "ALCrypto" (ptrKey As RSAKey, ByVal bits As Long, ByVal pfn As Long, ByVal pfnparam As Long) As Long Public Declare Function rsa_public_key_blob Lib "ALCrypto" (ptrKey As RSAKey, ByVal blob As String, blobLen As Long) As Long Public Declare Function rsa_private_key_blob Lib "ALCrypto" (ptrKey As RSAKey, ByVal blob As String, blobLen As Long) As Long Public Declare Function rsa_createkey Lib "ALCrypto" (ByVal pub_blob As String, ByVal pub_len As Long, ByVal priv_blob As String, ByVal priv_len As Long, ptrKey As RSAKey) As Long Public Declare Function rsa_encrypt Lib "ALCrypto" (ByVal CryptType As Long, ByVal data As String, dLen As Long, ptrKey As RSAKey) As Long Public Declare Function rsa_decrypt Lib "ALCrypto" (ByVal CryptType As Long, ByVal data As String, dLen As Long, ptrKey As RSAKey) As Long Public Declare Function rsa_sign Lib "ALCrypto" (ByRef ptrKey As RSAKey, ByVal data As String, ByVal dLen As Long, ByVal sig As String, ByRef sLen As Long) As Long Public Declare Function rsa_verifysig Lib "ALCrypto" (ByRef ptrKey As RSAKey, ByVal sig As String, ByVal sLen As Long, ByVal data As String, ByVal dLen As Long) As Long Public Declare Function fnRSA Lib "ALCrypto" (ptrKey As RSAKey, ByVal bits As Long, ByVal pfn As Long, ByVal pfnparam As Long) As Long 'Public Declare Function fnRSA Lib "rsa" (ByVal bits As Long, ptrKey As RSAKey, ByVal pfn As Long, ByVal pfnparam As Long) Private Const MAXPHASE& = 5 Type PhaseType exponential As Byte startpoint As Byte total As Byte param As Byte current As Byte n As Byte ' if exponential */ mult As Byte ' if linear */ End Type Type ProgressType nphases As Long phases(0 To MAXPHASE - 1) As PhaseType total As Byte divisor As Byte range As Byte hwndProgbar As Long End Type Public Sub ProgressUpdate(ByVal param As Long, ByVal action As Long, ByVal phase As Long, ByVal iprogress As Long) Debug.Print "Progress Update received " & param & ", action: " & action & ", iprogress: " & iprogress End Sub Sub Main() Debug.Print "here!" End Sub Private Function FnPtrLong(ptr As Long) As Long FnPtrLong = ptr End Function '' ' Converts a string into a hex string. ' Private Function Str2Hex(str As String) As String Dim strHex$ Dim arrBytes() As Byte arrBytes = StrConv(str, vbFromUnicode) Dim I& Dim charHex As String For I = LBound(arrBytes) To UBound(arrBytes) charHex = Hex(arrBytes(I)) If Len(charHex) = 1 Then ' pad leading zero charHex = "0" & charHex End If strHex = strHex & charHex Next Str2Hex = strHex End Function --- NEW FILE: Project1.vbp --- Type=Exe Form=Form1.frm Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\System32\stdole2.tlb#OLE Automation Module=Module1; Module1.bas Module=modBase64; ..\..\activelock2\src\modBase64.bas IconForm="Form1" Startup="Form1" HelpFile="" ExeName32="Project1.exe" Command32="" Name="Project1" HelpContextID="0" CompatibleMode="0" MajorVer=1 MinorVer=0 RevisionVer=0 AutoIncrementVer=0 ServerSupportFiles=0 VersionCompanyName="Karora Technologies Inc." CompilationType=0 OptimizationType=0 FavorPentiumPro(tm)=0 CodeViewDebugInfo=0 NoAliasing=0 BoundsCheck=0 OverflowCheck=0 FlPointCheck=0 FDIVCheck=0 UnroundedFP=0 StartMode=0 Unattended=0 Retained=0 ThreadPerObject=0 MaxNumberOfThreads=1 [MS Transaction Server] AutoRefresh=1 |