ProtectKit3.5 It is copy protection for your software. It prevents software theft. It prevents unauthorized copies of your software from running. It stops people from stealing your software. It protects applications from illegal copying and unauthorized use.

ProtectKit3.5

ProtectKit3.5 Documentation

Protects Your Software From Unauthorized Use!

ProtectKit3.5

Documentation

Includes ProtectKit3 and ProtectKit.NET!

Newtone Corporation
1-6-43 Kotobuki
Nagaoka City, Niigata Prefecture
940-0015, JAPAN
Fax: +81-258-24-7905
http://www.imagekit.com
prsupport@imagekit.com

ProtectKit3.5 Home || Online Store || ProtectKit3.5 Online Help
Copyright © Newtone Corporation - All rights reserved


What is the ProtectKit3.5? It is copy protection for your software. It prevents software theft. It prevents unauthorized copies of your software from running. It stops people from stealing your software. It protects applications from illegal copying and unauthorized use.

ProtectKit3.5

Introduction: What is the ProtectKit3.5?

What is the ProtectKit3.5?

The ProtectKit3.5 is a software developer toolkit made by Newtone Corporation. The ProtectKit3.5 includes two versions of the ProtectKit, the previous version called the ProtectKit3 and a newer version for .NET Framework, called the ProtectKit.NET. The ProtectKit3 provides protection for Win32(64) applications. The ProtectKit.NET provides protection for .NET applications. For details about the specific programming environments supported by the ProtectKit3.5 please refer to supported environments.

What does the ProtectKit3.5 do?

In a nutshell, the ProtectKit prevents people from stealing your software applications. It does this by preventing unauthorized copies of your software applications from running without your permission. That means that every copy of your application that is currently working is a copy that was authorized by you.

The ProtectKit3.5 protects your software without the use of any special hardware. The protection provided is completely software based. There is no need for dongles, usb locks, or other hardware. You simply write the ProtectKit3.5 code into your application and that's it. With a few simple steps, you can protect your software applications with one of the strongest copy protection systems available.

The ProtectKit3.5 has two types of protection systems; password protection and network protection. Password protection is supported by both the ProtectKit3 (for Win32/64 applications) and the ProtectKit.NET (for .NET Applications). Network protection is supported by the ProtectKit3 (for Win32/64 applications) only.

How does the password protection work?

Password protection locks your software application until it is unlocked by a password. The ProtectKit3.5 makes 5 types of passwords available, each with its own features. The most important feature of all types of password protection is that the passwords are unique to the PC where the application is running. If a protected application is copied to another PC, even if that application has already been unlocked, it will not work on the new PC until the application has been unlocked on that PC.

Password protection does this by using a lockword in combination with the hardware signature of the PC where the application is running. The ProtectKit3.5's Password Generator creates a password, unique to that PC, that unlocks the application on that PC and only that PC. This is why protected applications copied to different PCs will not work until they are unlocked with a password specific to that PC.

The 5 types of password protection available are: "standard" protection, "number of uses" protection, "number of days" protection, "number of months" protection, and "expiration date" protection. Passwords can be one time passwords or renewable passwords. When locked applications are unlocked with one time passwords, the unlocked application will remain unlocked on that PC indefinitely. When applications are unlocked using renewable passwords, the unlocked application will work for the specified number of uses, days, or months. After the number of uses, number of days or number of months has been exceeded, the application will be locked again until a different renewable password is entered. Being able to use renewable passwords gives you the option of renting or leasing your software applications. The ProtectKit3.5 provides three ways to generate passwords. Passwords can be generated programatically and automatically sent to your endusers.

How does the network protection work?

The ProtectKit3.5 provides network protection for your Win32 (Win64) applications. Network protection detects the number of instances of your application that are running on a local network at the same time. Network protection gives your application's the ability to communicate with each other to detect unauthorized copies and to disable them. With network protection, you can set the number of applications that you will allow to run simulataneously on a local network.

Network protection does not support .NET applications.


Features of the ProtectKit3.5

ProtectKit3.5

Introduction: Features

Some Features of the ProtectKit3.5

Password protection is available in VB.NET /C#.NET (.NET Framework 2.0 and above) for both 32 bit applications and 64 bit applications.

Password protection supports 64 bit operating systems.
Password protection can be used on 64 bit operating systems (both 32 bit applications and 64 bit applications supported)

Password protection supports 64 bit applications.
Password protection can be used with 64 bit applications.

Supports Windows 8.1
ProtectKit3.5 protection can be used in Windows 8.1 / 8 / 7 / Vista / XP / Server 2012 / Server 2008 R2 / Server 2008 / Server 2003

Supports digital signatures
Digitally signed applications can be protected with the ProtectKit3.5.

Special hardware is not necessary
The ProtectKit3.5 protects your applications from unauthorized copying without the need for any special hardware. Because the ProtectKit3.5 is a software based copy-protection solution, there is no need for dongles, usb locks, or other hardware. Protected applications will run on desktop PCs and on laptops.

No additional runtime costs
The ProtectKit3.5 is runtime license free. This means that a registered user of a ProtectKit3.5 PC developer license can protect as many different applications as they wish and deploy an unlimited number of each application without any additional costs, fees, or limitations

A direct impact on your bottom line
The ProtectKit3 increases your sales because copies of your software that are not authorized by you, will not run until you have authorized them. It is as simple as that. No more pirated software. Every copy of your protected application that is currently being used will have been paid for. This will have a huge and direct bearing on your revenue and ultimately on your bottom line.

ProtectKit3.5 protected applications can be deployed in exactly the same way as your regular applications
Applications protected by the ProtectKit3.5 can be distributed in the same way that you have always distributed your applications (CD-ROM, Floppy Disk, Email distribution, Internet download, etc). Because the ProtectKit3.5 protection is embedded within your application, there is no need to change the way you deploy your applications.

The ProtectKit3.5 can detect when unauthorized copies of your software are running on a local network. (Not available for .NET applications)
When copies of your protected application are running on a network, by using Network protection, you can detect and control how many instances of your application are running. What is more, you can verify if they are authorized and disable applications when they are not.

Using the ProtectKit3.5, you can rent or lease your applications
Because you have the option of allowing renewable passwords, you can authorize your application to work for a specific period of time or number of uses. After that has been exceeded, the application will be locked until a renew password is generated. By setting "number of use", "number of days", or "number of months" protection with renewable passwords, you have the ability to rent or lease software.

The ProtectKit3.5 retrieves a hardware signature from the PC that is running your application
The ProtectKit3.5 uses a combination of a lockword and the hardware signature where the application is running to create a unique password. Even after the application has been unlocked on one PC, if that application is copied to a different PC, it will not run. The ProtectKit3.5 allows you to determine what combination of hardware will comprise a unique hardware signature (CPU, Motherboard, Videocard, NetworkCard). This gives you added flexibility when protecting your application. In addition to this, if your enduser's system crashes and they must format their hard drive, as long as the hardware signature has not changed, the same password will unlock your application on the new hard drive. There is no need for the enduser to request a new password from the application vendor.

3 ways to generate passwords
The ProtectKit3.5 provides you with three types of password generators so that you can provide passwords to your users seamlessly. The password generator EXE is a runtime password generator that doesn't require any programming. Simply enter the lockword and the hardware signature (PcID) from the enduser's machine and you can generate the password needed to unlock that application ON THAT MACHINE. The password generator OCX and DLL provide a programmable API that allows you to generate the needed passwords programmatically. The Email API gives you an easy seamless way to send the generated passwords to the enduser so they can unlock the application.


Supported Environment

The ProtectKit3.5 combines the ProtectKit3, which supports Win32(64) applications, with the ProtectKit.NET, which supports .NET applications. Below is a list of operating systems and development environments supported by the ProtectKit3.5.

ProtectKit3 (for Win32/64 applications)

The ProtectKit3 supports the following platforms:

Windows 8.1
Windows 8
Windows 7
Windows Vista
Windows XP
Windows Server 2012
Windows Server 2008 R2
Windows Server 2008
Windows Server 2003

The ProtectKit3 supports the following development environments:

Visual Basic 6.0
Visual C++ 2013 / 2012 / 2010 / 2008 / 2005 / 2003 / 6.0
Embarcadero RAD Studio XE6 / XE5 / XE4 / XE3 / XE2 / XE / 2010
(C++Builder XE6, XE5, XE4, XE3, XE2, XE, 2010 / Delphi XE6, XE5, XE4, XE3, XE2, XE, 2010)
CodeGear RAD Studio 2009 (C++Builder 2009 / Delphi 2009 for Win32)
CodeGear RAD Studio 2007 (C++Builder 2007 / Delphi 2007 for Win32)
Borland Developer Studio 2006 (C++Builder / Delphi for Win32)
Delphi 2005(Win32) / 7 / 6 / 5
C++Builder 6 / 5

The ProtectKit3 does not support Visual Studio.NET Managed Code. For Visual Studio.NET, please refer to the ProtectKit.NET

ProtectKit.NET (for .NET Applications)

The ProtectKit.NET supports the following platforms:

Windows 8.1
Windows 8
Windows 7
Windows Vista
Windows XP
Windows Server 2012
Windows Server 2008 R2
Windows Server 2008
Windows Server 2003

The ProtectKit.NET supports the following development environments:

Visual Studio 2013
Visual Studio 2012
Visual Studio 2010
Visual Studio 2008
Visual Studio 2005

The ProtectKit.NET does not support unmanaged code. For unmanaged code, please refer to the ProtectKit3.


Installing the ProtectKit3.5. The ProtectKit3.5 provides protection for your software. It prevents software theft. It prevents unauthorized copies of your software from running. It stops people from stealing your software. It protects applications from illegal copying and unauthorized use.

ProtectKit3.5

Installing the ProtectKit3.5

Run the ProtectKit3.5 installer with Administrator permissions. After installation, the following folders will be created under the ProtectKit3.5 installation directory:

Installed Folder Structure

ProtectKit3.5
|
|--- Help - Documentation for ProtectKit3.5
|
|--- Network Protection
| |--- Function Files - ProtectKit3 files necessary for network type protection
| |--- Include Files - PkitNet32(64).dll function definition files for various development containers
| |--- Sample Programs - Sample programs for various development containers
| |--- Set Network Protection Tool - This tool sets network protection for Win32(63) applications
|
|--- Password Protection
|--- PasswordGenerators - These Password Generators allow you to generate passwords for your protected applications
| |--- Include Files - Function definition files for the Pr3PassGen.dll for various development containers
| |--- Sample Programs - Sample programs for various development containers
|
|--- ProInfo Files - Protection information files
|
|--- ProtectKit System Driver - These files register the ProtectKit system driver in the target PC.
|
|--- Set Password Protection
|--- For .NET
| |--- Profunc Files (.NET) - The ProtectKit function files needed for .NET applications
| |--- Sample Programs (.NET) - Sample .NET projects
| |--- Set Password Protection Tool (.NET) - This tool sets password protection for .NET applictions
|
|--- For Win32(64)
| |--- Include Files (Win32-64) - ProtectKit function definition files for various Win32(64) development containers
| |--- ProFunc Files (Win32-64) - The ProtectKit function files needed for Win32(64) applications
| |--- Sample Programs (Win32-64) - Sample programs for various Win32(64) development containers
| |--- Set Password Protection Tool (Win32-64) - This tool sets password protection for Win32(64) applications

Important ProtectKit3.5 Files

Network Protection (for Win32/64 applications only)

Set Network Protection Tool
Pr3SetProtectNet.exe - This tool sets network protection information (for both 32 and 64 bit Win32/64 applications)

Network Protection Function Files
PkitNet32.dll - File that provides network protection functionality (for 32 bit applications)
PkitNet64.dll - File that provides network protection functionality (for 64 bit applications)

Password Protection (for both Win32/64 and .NET applications)

ProtectKit System Driver
DdScm.exe - Executable program needed to install the ProtectKit System Driver in the runtime environment. This driver enables the ProtectKit to retrieve the hardware configuration from the target PC and also to write protection information to registry and file systems. The DdScm.exe automatically recognizes whether the target PC is a 32 bit or 64 bit environment and runs the appropriate EXE (DdScm32.exe or DdScm64.exe)
DdScm32.exe - This EXE works with DdScm.exe to run the ProtectKit in 32 bit Windows runtime environment
DdScm64.exe - This EXE works with DdScm.exe to run the ProtectKit in 64 bit Windows runtime environment

Password Protection Information Files
ProInfo32.dll - Protection information file for 32 bit applications
ProInfo64.dll - Protection information file for 64 bit applications

Password Generators
Pr3PassGen.exe - Password generating EXE. This executable program generates passwords manually
Pr3PassGen.dll - Password generating DLL. This Win32 dll allows you to generate passwords programatically
Pr3PassGen.ocx - Password generating OCX This OCX allows you to generate passwords programatically

Password Protection Function Files For .NET
Newtone.ProtectKit.Win.Password.dll - .NET assembly providing ProtectKit.NET functionality
ProFuncNET32.dll - File that provides ProtectKit.NET password protection functionality for 32 bit .NET applications
ProFuncNET64.dll - File that provides ProtectKit.NET password protection functionality for 64 bit .NET applications
PrNETSetProtect.exe - This is the Set Password Protection Tool for .NET applications. It sets the ProtectKit.NET protection information for both 32 and 64 bit .NET applications

Password Protection Function Files For Win32/64
ProFunc32.dll - File that provides ProtectKit3 password protection functionality for 32 bit applications
ProFunc64.dll - File that provides ProtectKit3 password protection functionality for 64 bit applications
Pr3SetProtect.exe - This is the Set Password Protection Tool for Win32(64) applications. It sets the ProtectKit3 password protection information for both 32 and 64 bit applications


Technical Support

ProtectKit3.5

ProtectKit3.5 Technical Support

How to Receive Technical Support for the ProtectKit3.5

Registered users of the ProtectKit3.5 are entitled to free technical support for as long as that support is offered.

To become a registered user of the ProtectKit3.5, send your name and email address along with the serial number of the copy of the ProtectKit3.5 you are using to register@imagekit.com. This is the product serial number that you received at the time of purchase. If you do not have a serial number, please let us know by emailing us at questions@imagekit.com.

When contacting us for technical support, please be sure to include:

User Information:
1. Your name
2. Your email address or other contact information

Product Information:
1. Product name
2. Version
3. Serial number
4. ActiveX or DLL file timestamp

Environment Information:
1. Operating System
2. Development Container
3. Using ActiveX or DLL

Query Information:
Please explain the problem or question that you have. If possible, please include the steps that are needed for us to recreate the situation. If the situation is difficult to explain, please feel free to include sample code or a sample project. When sending sample projects, please keep them as simple as possible and still illustrate the problem. Be sure to remove all code, third party tools, and other programming, not related to the issue. We are unable to answer questions related to third party tools or Windows API.

Licensing and Technical Support:

The ProtectKit3.5 is a PC Developer License. 1-PC developer license entitles one registered user to receive technical support. For multiple license pack holders, each user of the ProtectKit3.5 must complete user registration.

We do not provide support for unregistered or trial version users.

Send all support inquiries to prsupport@imagekit.com


About ProtectKit3.5 Help File

About This Help File

The ProtectKit3.5 is a software developer toolkit that provides functions for protecting your applications from theft and unauthorized copying.

The ProtectKit3.5 Help file combines explanations for the ProtectKit3, which supports Win32(64) applications, with explanations for the ProtectKit.NET, which supports .NET applications. Though similiar, there are some important differences between the functionality of the ProtectKit3 and the ProtectKit.NET. To clarify which environment is being explained, we have color coded the banner at the top of each help page.

Help Page Banner Color

When help pages relate to the ProtectKit3.5 in general or relate to both the ProtectKit3 and the ProtectKit.NET, the color of the banner at the top of that help page will be teal. The banner will say "ProtectKit3.5".

ProtectKit3.5 Banner Color: Teal

When help pages relate to the ProtectKit3 functionality, the color of the banner at the top of that help page will be green. The banner will say "ProtectKit3".

ProtectKit3 Banner Color: Green

When help pages relate to the ProtectKit.NET functionality, the color of the banner at the top of that help page will be blue. The banner will say "ProtectKit.NET".

ProtectKit.NET Banner Color: Blue


Password Protection Overview: It is copy protection for your software. It prevents software theft. It prevents unauthorized copies of your software from running. It stops people from stealing your software. It protects applications from illegal copying and unauthorized use.

ProtectKit3.5

Password Protection: Overview

What is Password Protection?

Password protection allows you to lock your application until it is unlocked by a password.

The most important feature of the ProtectKit3.5's password protection is that the protection is unique to the PC where the application runs. By using a combination of a secret lockword that you determine and a unique hardware signature retrieved from the PC where the application is running, the ProtectKit3.5 generates a password that will unlock the application on that PC and only that PC. If a protected application is copied to another PC, even if that application has already been unlocked, it will not work until the application is unlocked on the new PC.

How do I set password protection?

You set password protection using the "Set Password Protection" tool. There are two different "Set Password Protection" tools, one for .NET applications and another for Win32(64) applications.

For information about setting protection in .NET applications see ProtectKit.NET Set Password Protection tool.

For information about setting protection in Win32(64) applications see ProtectKit3 Set Password Protection tool.

What types of passwords are available and what do they do?

There are 5 types of passwords that you can choose from:

1. Standard protection: This type of protection locks the application until it it unlocked with a password. After it has been unlocked, the application will run on that PC indefinitely. If the protected application is copied to another PC, it will not work until unlocked on the new PC. There is no "renewal password" option with this type of protection.

2. Number of uses protection: This protection sets the number of times an application can be used. The application can be used for the specified number of uses. Each time the application starts up, that is counted as one use. After the number of allowable uses has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of uses. After the number of allowable uses has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked with a new password, the application will not run indefinitely but will only run again for the number of allowable uses. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

3. Number of days protection: This protection sets the number of days an application can be used. The application can be used for the specified number of days. After the number of allowable days has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of days. After the number of allowable days has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked with a password, the application will not run indefinitely but will only run again for the number of allowable days. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

4. Number of months protection: This protection sets the number of months an application can be used. The application can be used for the specified number of months. After the number of allowable months has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of months. After the number of allowable months has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked with a password, the application will not run indefinitely but will only run again for the number of allowable months. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

5. Expiration date protection: This protection sets the date after which an application will be locked. The application will run until the specifed date is exceeded. After the specified date, the application is locked and will remail locked until unlocked with a password. After being unlocked, the application will run indefinitely. There is no "renewal password" option with this type of protection.

For details about setting password protection, please refer to "Set Password Protection Tool" in this help file.

What steps are needed to add password protection to my applications?

Adding password protection to your application is very easy:

1. Set ProtectKit code in your application.
2. Set protection information using the "Set Password Protection Tool".
3. Deploy Application.
4. Generate a password and send it to the user.

Click here for an overview of adding password protection to a .NET application or to a Win32(64) application.


Password Protection Example For .NET Apps It is copy protection for your software. It prevents software theft. It prevents unauthorized copies of your software from running. It stops people from stealing your software. It protects applications from illegal copying and unauthorized use.

ProtectKit.NET

Password Protection: Example For .NET Apps

To set password protection in .NET applications, follow these steps:

Step 1: Set ProtectKit code in your application.
Step 2: Set protection information using the "Set Password Protection Tool".
Step 3: Embed the protection file into your application.
Step 4: Obfuscate your application if desired.
Step 5: Digitally sign your application if desired.
Step 6: Deploy Application.
Step 7: Generate a password and send it to the user.

Here is an overview that explains how to set password protection in a .NET application.

.NET Example: (in Visual Basic .NET)

Step 1: Set ProtectKit code in your application

Check the ProtectKit status and the lockword:
You should do this when your application initializes. Here we chose to do this in the Form_Load event. That way, every time the application starts up, the passwordProtect Initialize function executes and checks whether the ProtectKit is running properly or not. Then the GetLockword function executes and retrieves the lockword from the application so you can check to see that it is correct.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
passwordProtect1.DllFileName = "ProFuncNET32.dll"

Dim ret As Integer = passwordProtect1.Initialize("VB_Sample1.exe", "ProInfo32.dll")
If (ret <> 0) Then
Select Case (ret)
Case -1 : MessageBox.Show("Unable to run application.")
Case 1 : MessageBox.Show("Service is not running.")
Case 2 : MessageBox.Show("Unable to load protection information file.")
Case 3 : MessageBox.Show("Lockword is incorrect.")
Case 4 : MessageBox.Show("Application must run on a local disk.")
Case 5 : MessageBox.Show("An error has been generated")
End Select
Me.Close()
End If

Dim s As String = passwordProtect1.GetLockword()
Dim ChkLockword() As String = "AbcdefgH"
If (s <> ChkLockword) Then
MessageBox.Show("Lockword is incorrect.")
Me.Close()
End If
label1.Text = "OK"
End Sub

Retrieve the PC's Hardware Signature (PcID):
The QueryPcID function retrieves the hardware signature of the PC based on the requirements that set by the Set Password Protection Tool. This PcID is used to generate a password to unlock the application on this PC.

Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
textBox1.Text = passwordProtect1.QueryPcID()
End Sub

Set the Password: After a valid password has been generated, passing that password into the SetPassword function will unlock the application. Here we do that within a button click event.

Private Sub button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button2.Click
passwordProtect1.SetPassword(textBox2.Text)
End Sub

Check Protection Status: The QueryProtect function checks the protection status and returns a value based on that status. This allows you to set the appropriate action that will occur based on the protection status return values.

Private Sub button3_Click(ByVal sender As System.Object,
                    ByVal e As System.EventArgs) Handles button3.Click
Dim ret As Integer = passwordProtect1.QueryProtect()
Select Case ret
Case -1 : label4.Text = "Unable to run application."
Case 0 : label4.Text = "Application is unlocked."
Case 1 : label4.Text = "Application is locked."
Case 2 : label4.Text = "Exceeded allowable number of uses."
Case 3 : label4.Text = "Exceeded allowable number of days."
Case 4 : label4.Text = "Exceeded allowable number of months."
Case 5 : label4.Text = "Application has expired."
Case 6 : label4.Text = "PC's clock has been turned back."
Case 7 : label4.Text = "PC is different."
Case 8 : label4.Text = "Protection file is incorrect."
Case 9 : label4.Text = "Lockword is incorrect."
Case 10 : label4.Text = "Password is incorrect."
Case 11 : label4.Text = "Other"
Case 12 : label4.Text = "Using an improper protection file."
End Select
'...Other programming code....
End Sub

Step 2: Set protection information

Use the Set Password Protection tool to set protection information into your application:

This tool writes protection information into a "protection information file" and also writes the same information into a file that is embedded into your application as a resource.

Password protection allows you to enable your applications in a variety of ways. Standard protection locks the application until it is unlocked. "Number of uses", "Number of days", and "Number of months" protection allow you to set how many times the application can be used, or for how many days, or months it will run. "Expiration date" protection sets a date after which the application stops running. The "renewable passwords" feature lets you enable an application that has stopped and it will be enabled again for the specified number of uses, days, or months.

Step 3: Embed the protection file into your application

In Step 2, the Set Password Protection tool, generated two files; a protection information file and another file containing the protection information that will be embedded in your application. To embed this file, use the Stream property of the PasswordProtect class.

How To Embed Protection Information:

There are two ways to embed the protection information into your application:

1. Open your application project, select the PasswordProtect class.
In the Properties window, click on button at the right of the Stream property (see image below) and set the path to the embedded protection file.

2. Open your application project and add the protection file to your project.
In the Properties Window, set the file's build action to "Embedded Resource".

After embedding the protection information, build the application.
Performing Steps 2 and 3, prior to Step 1, allows you to debug the protection portion of your code.

Step 4: Obfuscate your application

If you are obfuscating your compiled application, do that at this step. If you are not obfuscating your application, proceed to Step 5.

We highly recommend that you obfuscate your .NET applications. If your applications and resource files are not obfuscated, program code may be readable if your application is decompiled and your lockword and other protection information may be exposed. Obfuscating your .NET application and resource files using string encryption will prevent your programming code and protection information from being exposed.

Step 5: Digital signature

If you are digitally signing your application, do that at this step. If you are not digitally signing your application, proceed to Step 6.

Step 6: Deploy your application

Deploy your application and all its associated files to the target machine.

Step 7: Generate a password to unlock the application and send it the user

Three types of Password Generators

The ProtectKit3.5 includes three password generating programs. The runtime Password Generator (EXE) is an application that allows you to enter a lockword and a PcID to generate a password manually, without any need for programming. Using the lockword from Step 2 and the PcID retrieved from the enduser's PC, you can generate an unlock password, which you send to the enduser to unlock the application.

The Password Generator EXE

The Password Generator OCX and DLL files

These files provide the password generating functions in an easy to use API. This allows you to generate passwords programmatically using the lockword and retrieved PcID. You can also send the generated passwords to your users. These programming API allow you to do this seamlessly.

Below is sample code from a web application that uses VBScript to generate the password.

Set objCOM = Server.CreateObject("Pr3PassGen.PassGen")
objCOM.LockWord = varLockword
objCOM.PCID = varPCID
objCOM.PasswordType = varType
varUnlockword = objCOM.PS3GetPassword
Set objCOM = nothing

Here is Visual Basic code that uses the EMail API

ret = PS3SendMail("msv.newtone.co.jp", "info@newtone.co.jp", _
"NEWTONE", "paul@company.com", "Users", _
"PassWord Information", "Below is the password needed to unlock....")


Set Password Protection Tool (.NET)

ProtectKit.NET

Set Password Protection Tool for .NET

Set Password Protection Tool

The "Set Password Protection" tool sets password protection into your applications. This tool allows you to choose the type of password protection and all other protection settings that you need in order to password protect your applications. The "Set Password Protection" tool writes all protection information into a special protection information file (the ProInfo file). It also creates another file that must be embedded into your application as a resource.

It is this one to one correspondence between the protection information file and the protection information embedded in your application that enables protection. Depending on the type of password protection that you have chosen, protection information may also be written to the registry and to a separate file. The location in the registry, the registry key and value, where the protection information is written and the location in the file system where the protection information is saved to file is specified by you when you use the "Set Password Protection" tool.

No.1 and No.2 are the files created by the Set Password Protection tool.
No.1 is the file to be included as a resource in the .NET assembly that is using ProtectKit.NET protection.

IMPORTANT:
Be sure to obfuscate the .NET application assemblies that you are protecting. It is highly recommended that you also encrypt strings when your code is obfuscated. You must keep your lockword secret. Because of this the lockword code and the code that checks the lockword must be hidden or your password protection will compromised. Because .NET uses a CRL (Common Runtime Language), it is easy to decompile .NET assemblies making your unobfuscated code and unencrypted strings apparent.

Set Password Protection Tool Contents:

The following items are important when setting password protection in .NET applications:

Protection Information Files
ProInfo Files
Embedded Protection File

Protection Settings:
PC Identifiers
Lockword
Types of Passwords
Standard Protection
Number of Uses Protection
Number of Days Protection
Number of Months Protection
Expiration Date Protection
Renewable Passwords
Password Configuration
Registry Settings
File Settings


Set Password Protection Tool: ProInfo File

ProInfo File:

The ProInfo file is the file used by the ProtectKit.NET to store the password protection information.

In the screenshot of the Set Password Protection tool below, we are using Standard Password Protection with default settings. To start, you click the "Open" button and choose the ProInfo file that you will use to save protection settings. Once chosen, the path to the ProInfo file will appear. This is shown below in red.

In addition to writing the protection information into the ProInfo file, the Set Password Protection tool will also create another file that you must embed into your .NET application. It is this one to one correspondence between the protection information set in the ProInfo file and the protection information embedded in your application that enables protection. For details about embedding the protection information into your .NET application, please see Step #3 in Password Protection: Example For .NET Apps.

After you have chosen the appropriate protection settings, you click the Save or the SaveAs buttons. The Save button will save the ProInfo file and the other protection file in the location shown. The SaveAs button will allow you to rename these files, which is recommended for increased security. For information about renaming protection files, please see Ways to Increase Security.


Set Password Protection Tool: Embedded Protection File

Embedded Protection File

In addition to writing the protection information into the ProInfo file, the Set Password Protection tool will also create another file that you must embed into your .NET application. It is this one to one correspondence between the protection information set in the ProInfo file and the protection information embedded in your application that enables protection. For details about embedding the protection information into your .NET application, please see Step #3 in Password Protection: Example For .NET Apps.

In the screenshot of the Set Password Protection tool below, we are using Standard Password Protection with default settings. To start, you click the "Open" button and choose the ProInfo file that you will use to save protection settings. Once chosen, the path to the ProInfo file will appear. Below that the path to the protection file that must be embedded in your .NET application also appears. This is shown below in red.

After you have chosen the appropriate protection settings, you click the Save or the SaveAs buttons. The Save button will save the ProInfo file and the other protection file in the location shown. The SaveAs button will allow you to rename these files, which is recommended for increased security.


Set Password Protection Tool: PC Identifiers

Hardware Configuration Identifies the PC

PC Identifiers are the criteria that the ProtectKit.NET uses to uniquely identify the PC running the application. If the PC's hardware configuration does not correspond with the PC Indentifiers set in the protection information, then the ProtectKit.NET will determine that the application has been copied to a different machine. The application will then be locked and will not run.

Explanation of the PC Identifiers

In the screenshot of the Set Password Protection tool below, the red box indicates where the PC identifiers are set. In this section of the Set Password Protection tool, there are two radio buttons.

RadioButton 1: CPU, Motherboard Northbridge, VideoCard, and NetworkCard must all be different
This option means that the ProtectKit.NET will determine that the PC has changed when all 4 of these hardware identifiers are different from that saved in the password protection information. This option is the least severe option in regard to PC identification. If your customer updated their VideoCard, for example, this option would mean that the protected application would still work on that PC.

RadioButton 2: Choose which of the following must be different:
CPU, Motherboard Northbridge, VideoCard, NetworkCard

This option means that the ProtectKit.NET will determine that the PC has changed when any one of the selected hardware identifiers are different. This option is more severe in regard to PC identification. If your customer updated their VideoCard, for example, and you had selected that hardware item to identify the PC, then this option would mean that the protected application would no longer work on that PC.

Checkbox: Add Random Identifier to these PC Identifiers
This option lets you add a series of random numbers to the PC identifiers. These random numbers are saved in the registry and in a file in locations that you specify. For more information see Saving Protection Information in the Registry and Saving Protection Information to File.

This option is used in the follow cases:
a. If there is a possibility that different PCs may have the same hardware configuration, adding a random identifier will give your application the ability to uniquely identify each PC even though the hardware configuration is identical.

b. If you want to set renewable passwords.
The renewable password option is available when setting "number of uses", "number of days", and "number of months" protection. Renewable passwords allow you to lease software for a specified number of days or months or for a specified number of uses. For more information see Renewable Passwords.

How the PC Identifier is constructed

The PC identifiers are used to construct an "identifier string". Consider the following hardware example:

CPU
Idenfication: 10386100640
1 - Manufacturer number
0 - 3DNow command set not supported
3 - Stepping ID
8 - Modal
6 - Command family
1 - Supports MMX

Motherboard Northbridge
Vendor Number: 8086
Product Number: 7124

Video Card
Vendor Number: 8086
Product Number: 7125

Network Card
MAC address: 00E0297CCF83

Random Identifiers
2529609067

In this case the PC identifing string is:
10386100640808671248086712500E0297CCF832529609067

IMPORTANT!!

1. Endusers sometimes change their CPU, Video Card, and Network Card. Be aware that depending on the PC Identifiers that you set, changing these items may cause your application to stop running even though the PC hasn't changed.

2. There are PCs whose video card information cannot be retrieved.

3. Some PCs have multiple CPU and network cards. This may cause inconsistant results when the CPU and network card information is retrieved.


Set Password Protection Tool: Lockword

Lockword

The lockword is used to construct a "lock" for the application. Use the Set Password Proection tool to set the lockword (see area in red in the screenshot below).

The lockword must consist of English alphabet (a through z) and/or numbers 0 through 9. The lockword must contain at least 8 characters and cannot exceed 64 characters. We strongly recommend that each application have a different lockword.

IMPORTANT!!! The lockword must remain secret. Do not reveal it to anyone.


Set Password Protection Tool: Protection Type

The Set Password Protection tool allows you to choose from 5 different password types. The password type determines the kind of password protection that is applied to your .NET application. Each password type has different features.

Protection Type

Standard Protection: This type of protection locks the application until it it unlocked with a password. After it has been unlocked, the application will run on that PC indefinitely. If the protected application is copied to another PC, it will not work until unlocked on the new PC. There is no "renewal password" option with this type of protection.

Number of Uses Protection: This protection sets the number of times an application can be used. The application can be used for the specified number of uses. Each time the application starts up, that is counted as one use. After the number of allowable uses has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of uses. After the number of allowable uses has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked with a new password, the application will not run indefinitely but will only run again for the number of allowable uses. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

Number of Days Protection: This protection sets the number of days an application can be used. The application can be used for the specified number of days. After the number of allowable days has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of days. After the number of allowable days has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked with a password, the application will not run indefinitely but will only run again for the number of allowable days. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

Number of Months Protection: This protection sets the number of months an application can be used. The application can be used for the specified number of months. After the number of allowable months has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of months. After the number of allowable months has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked with a password, the application will not run indefinitely but will only run again for the number of allowable months. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

Expiration Date Protection: This protection sets the date after which an application will be locked. The application will run until the specifed date is exceeded. After the specified date, the application is locked and will remail locked until unlocked with a password. After being unlocked, the application will run indefinitely. There is no "renewal password" option with this type of protection.


Set Password Protection Tool: Standard Protection

Standard Protection

Standard protection locks the application until it it unlocked with a password. After it has been unlocked, the application will run on that PC indefinitely. If the protected application is copied to another PC, it will not work until unlocked on the new PC. There is no "renewal password" option with this type of protection.

In the above screenshot, we have checked the box "Add Random identifiers to PC Identifiers" (see area indicated in yellow). When this is checked, that information is stored in a location in the registry. You set the location within the registry using the Set Password Protection tool (see area indicated in orange). In this example, the protection information is saved in the registry in this location:

Key: HKEY_CLASSES_ROOT
SubKey: TestApp_Info
Name: Random

If the subkey does not exist, it will be created. You can choose to save protection information under the Key "HKEY_LOCAL_MACHINE\SOFTWARE" using the drop down menu of the combobox.

Unlike our example above, we recommend that you use unrecognizable strings for the subkeys and names where you are saving protection information. This makes it more difficult for someone to discover your protection information. For more information, please see Saving Protection Information To Registry.

Protection information can also be saved to file. This is useful as a backup in case the information in the registry is lost. The file must be saved under the Windows folder or the Windows\System folder in a subfolder and filename that you specify. If the subfolder does not exist, IT WILL NOT BE CREATED. The subfolder must exist prior to saving the protection information to file within this subfolder. For more information, please see Saving Protection Information To File.


Set Password Protection Tool: Number Of Uses Protection

Number of Uses Protection

This protection sets the number of times an application can be used. The application can be used for the specified number of uses. Each time the application starts up, that is counted as one use. After the number of allowable uses has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of uses. After the number of allowable uses has been exceeded, the application is locked and will remain locked until it is unlocked with another renewable password. After being unlocked with a new renewable password, the application will only run again for the number of allowable uses. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.
For more information, please refer to Using Renewable Passwords.

Screenshot 1: Number of uses protection with ordinary password

In the screenshot below, the Protection Type is set to "Number of Uses" and the number of allowable uses is set to 10. (see area indicated in red).

When number of uses protection is selected, the count of allowable uses is stored in a location in the registry. You set the location within the registry using the Set Password Protection tool. The area is indicated in the screenshot below in orange.

In this example, the protection information is saved in the registry in this location:

Key: HKEY_CLASSES_ROOT
SubKey: TestApp_Info
Name: Status

If the subkey does not exist, it will be created. You can choose to save protection information under the Key "HKEY_LOCAL_MACHINE\SOFTWARE" using the drop down menu of the combobox.

Unlike our example below, we recommend that you use unrecognizable strings for the subkeys and names where you are saving protection information. This makes it more difficult for someone to discover your protection information. For more information, please see Saving Protection Information To Registry.

Protection information can also be saved to file. This is useful as a backup in case the information in the registry is lost. The file must be saved under the Windows folder or the Windows\System folder in a subfolder and filename that you specify. If the subfolder does not exist, IT WILL NOT BE CREATED. The subfolder must exist prior to saving the protection information to file within this subfolder. For more information, please see Saving Protection Information To File.

Screenshot 2: Number of uses protection with renewable password

In the screenshot below, the Protection Type is set to "Number of Uses" and the number of allowable uses is set to 10. (see area indicated in red). In the area indicated in yellow, you can see that random information is added to the PC identifiers and renewable passwords are being used. To use renewable passwords, random information must be added to the PC Identifiers. When random information is added to the PC identifiers, an additional Subkey must be added to the registry information. You can see the "Registry" tab in orange in the above screenshot. In the screenshot below, the area indicated in orange shows the "File" tab. This is how you can set a location of a subfolder and a filename where the protection information is saved.


Set Password Protection Tool: Number Of Days Protection

Number of Days Protection

This protection sets the number of days an application can be used. The application can be used for the specified number of days. After the number of allowable days has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of days. After the number of allowable days has been exceeded, the application is locked and will remain locked until it is unlocked with another renewable password. After being unlocked with a new renewable password, the application will only run again for the number of allowable days. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.
For more information, please refer to Using Renewable Passwords.

Screenshot 1: Number of days protection with ordinary password

In the screenshot below, the Protection Type is set to "Number of Days" and the number of allowable days is set to 30. (see areas indicated in red).

When number of days protection is selected, the count of allowable days is stored in a location in the registry. You set the location within the registry using the Set Password Protection tool. The area is indicated in the screenshot below in orange.

In this example, the protection information is saved in the registry in this location:

Key: HKEY_CLASSES_ROOT
SubKey: TestApp_Info
Name: Status

If the subkey does not exist, it will be created. You can also choose to save protection information under the Key "HKEY_LOCAL_MACHINE\SOFTWARE" using the drop down menu of the combobox.

Unlike our example below, we recommend that you use unrecognizable strings for the subkeys and names where you are saving protection information. This makes it more difficult for someone to discover your protection information. For more information, please see Saving Protection Information To Registry.

Protection information can also be saved to file. This is useful as a backup in case the information in the registry is lost. The file must be saved under the Windows folder or the Windows\System folder in a subfolder and filename that you specify. If the subfolder does not exist, IT WILL NOT BE CREATED. The subfolder must exist prior to saving the protection information to file within this subfolder. For more information, please see Saving Protection Information To File.

Screenshot 2: Number of days protection with renewable password

In the screenshot below, the Protection Type is set to "Number of Days" and the number of allowable days is set to 30. (see area indicated in red). In the area indicated in yellow, you can see that random information is added to the PC identifiers and renewable passwords are being used. To use renewable passwords, random information must be added to the PC Identifiers. When random information is added to the PC identifiers, an additional Subkey must be added to the registry information. You can see the "Registry" tab in orange in the screenshot below and the locations in the registry where the information is saved. To see an example of the "File" tab, please refer to the Number of Uses protection.


Set Password Protection Tool: Number Of Months Protection

Number of Months Protection

This protection sets the number of months an application can be used. The application can be used for the specified number of months. After the number of allowable months has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of months. After the number of allowable months has been exceeded, the application is locked and will remain locked until it is unlocked with another renewable password. After being unlocked with a new renewable password, the application will only run again for the number of allowable months. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.
For more information, please refer to Using Renewable Passwords.

Screenshot 1: Number of months protection with ordinary password

In the screenshot below, the Protection Type is set to "Number of Months" and the number of allowable months is set to 2. The start date will be counted from "the month of first use". (see areas indicated in red). There are 3 possible choices for setting the start date when the first month is counted.

Setting the start date:
With the number of months protection, you can choose among 3 different possible starting dates. Choose one of the start dates in the drop down menu next to the number of months (see area in red in screenshot below).
From day of first use: Starts on the day that the application is executed for the first time.
From month of first use: Starts at the beginning of the month in which the application is executed for the first time.
From month after first use: Starts at the beginning of the month following the month in which the application is executed for the first time.

For example: Suppose the number of months protection is set for 2 months and the first time the application runs is on 2015/03/16.
From day of first use: Number of months protection begins from 2015/03/16. The application will run until 2015/05/16, after which it will be locked.
From month of first use: Number of months protection begins from 2015/03/01. The application will run until 2015/05/01, after which it will be locked.
From month after first use: Number of months protection begins from 2015/04/01. The application will run until 2015/06/01, after which it will be locked.

When number of months protection is selected, the count of allowable months and the start date are stored in a location in the registry. You set the location within the registry using the Set Password Protection tool. The area is indicated in the screenshot below in orange. In this example, the protection information is saved in the registry in this location:

Key: HKEY_CLASSES_ROOT
SubKey: TestApp_Info
Name: Status

If the subkey does not exist, it will be created. You can also choose to save protection information under the Key "HKEY_LOCAL_MACHINE\SOFTWARE" using the drop down menu of the combobox.

Because the checkbox for adding random information to the PC Identifiers is checked, that information must also be saved in the registry. That protection information is saved in the registry in this location:

Key: HKEY_CLASSES_ROOT
SubKey: TestApp_Info
Name: Ran

If the subkey does not exist, it will be created.

Unlike our example below, we recommend that you use unrecognizable strings for the subkeys and names where you are saving protection information. This makes it more difficult for someone to discover your protection information. For more information, please see Saving Protection Information To Registry

Protection information can also be saved to file. This is useful as a backup in case the information in the registry is lost. The file must be saved under the Windows folder or the Windows\System folder in a subfolder and filename that you specify. If the subfolder does not exist, IT WILL NOT BE CREATED. The subfolder must exist prior to saving the protection information to file within this subfolder. For more information, please see Saving Protection Information To File

Screenshot 2: Number of months protection with renewable password

In the screenshot below, the Protection Type is set to "Number of Months" and the number of allowable months is set to 2. The start date will be counted "from the month of first use". (see area indicated in red). In the area indicated in yellow, you can see that random information is added to the PC identifiers and renewable passwords are being used. To use renewable passwords, random information must be added to the PC Identifiers. When random information is added to the PC identifiers, an additional Subkey must be added to the registry information. You can see the "Registry" tab in orange in the screenshot below and the locations in the registry where the information is saved. To see an example of the "File" tab, please refer to the Number of Uses protection.


Set Password Protection Tool: Expiration Date Protection

Expiration Date Protection

This protection sets the date after which an application will be locked. The application will run until the specifed date is exceeded. After the specified date, the application is locked and will remail locked until unlocked with a password. After being unlocked, the application will run indefinitely. There is no "renewal password" option with this type of protection.

In the screenshot below, the Protection Type is set to "Until Specified Date" and the "Use Until" is set to December 31, 2015. (see area indicated in red).

When expiration date protection is selected, the protection information is stored in a location in the registry. You set the location within the registry using the Set Password Protection tool. The area is indicated in the screenshot below in orange. In this example, the protection information is saved in the registry in this location:

Key: HKEY_CLASSES_ROOT
SubKey: TestApp_Info
Name: Status

If the subkey does not exist, it will be created. You can also choose to save protection information under the Key "HKEY_LOCAL_MACHINE\SOFTWARE" using the drop down menu of the combobox. For more information, please see Saving Protection Information To Registry

Protection information can also be saved to file. This is useful as a backup in case the information in the registry is lost. The file must be saved under the Windows folder or the Windows\System folder in a subfolder and filename that you specify. If the subfolder does not exist, IT WILL NOT BE CREATED. The subfolder must exist prior to saving the protection information to file within this subfolder. For more information, please see Saving Protection Information To File

.


Set Password Protection Tool: Using Renewable Passwords

Using Renewable Passwords

The "Set Password Protection" tool allows you to choose to generate ordinary passwords or renewable passwords. Both kinds of passwords are used to unlock protected applications.

Ordinary passwords will unlock an application and once it has been unlocked, the application will remain unlocked indefinitely on that PC.

Renewable passwords allow you to unlock your applications for a specified number of uses, number of days, or number of months. Renewable passwords are only available for these three types of password protection.

Number of Uses Protection

Number of Days Protection

Number of Months Protection

When you use one of these types of password protection, your application will run initially for the specified number of uses, days, or months. Once that has been exceeded, the application will be locked. With the renewable password option, the password will unlock that application only for the specified number of uses, days, or months. After that the application is again locked and must be "renewed" with another new password. Renewable passwords will only enable the application for that specified number of uses, days, or months.

Renewable passwords are very useful if you want to rent or lease your software applications.


Set Password Protection Tool: Password Configuration

Password Configuration

The Set Password Protection tool allows you to configure passwords in the following three ways:

Numeric - numbers only (digits 0 thru 9)
i.e. 1234567890

Alpha Numeric - alphabet letters, both upper and lower case, and numbers (a thru z, A thru Z, and 0 thru 9)
i.e. 1234567890ABCabc

Alpha Numeric (All capitals)- alphabet letters, only upper, and numbers (A thru Z, 0 thru 9)
i.e. 1234567890ABC

The screenshot below shows how to set the password configuration in the Set Password Protection tool. (See area indicated in red)


Set Password Protection Tool: Saving Protection Information in the Registry

Saving Protection Information in the Registry

With the Set Password Protection tool, you can save necessary protection information, like number of days, number of uses, random indentifiers, etc., in both the registry and to file. The screenshot of the Set Password Protection tool below shows how to set the registry keys. (See area indicated in red)

Being able to set protection information in both registry and file gives you added protection. If the enduser happens to delete the protection information from the registry, it will still remain in the file and can be restored to the registry. Likewise, if the file with the saved protection information is deleted, it can be restored from the information stored in the registry.

How to Save Information To Registry

(please refer to the above screenshot)

1. "Key" - This sets the main key in the registry where the protection information is stored.
HKEY_CLASSES_ROOT
HKEY_LOCAL_MACHINE\SOFTWARE

2. "Location Where Protection Information is Saved "

SubKey - This sets the registry subkey where the protection information is stored.

Name - The name of the key where the values are stored.

3. "Location Where Random Identifier is Saved"

SubKey - This sets the registry subkey where the random identifier is stored.

Name - The name of the key where the values are stored.

If the subkey does not exist, it will be created in the registry.

IMPORTANT!!
Be sure to set the registry keys in such a way that their meaning is not easily understood. Use deep level hierarchy and make sure that the name of the subkeys cannot be inferred from the name of the application.


Set Password Protection Tool: Saving Protection Information to File

Saving Protection Information to File

With the Set Password Protection tool, you can save necessary protection information, like number of days, number of uses, random indentifiers, etc., in both a file and in the registry. The screenshot of the Set Password Protection tool below shows how to set information to file. (See area indicated in red)

Being able to set protection information in both registry and file gives you added protection. If the enduser happens to delete the protection information from the registry, it will still remain in the file and can be restored to the registry. Likewise, if the file with the saved protection information is deleted, it can be restored from the information stored in the registry.

Saving Information To File

(please refer to the above screenshot)

1. "Folder" - This sets the folder where the protection information is stored.
Windows Folder
Windows System
(i.e. "C:\Windows" or "C:\Windows\system32")

2. "Location Where Protection Information is Saved "

SubFolder - This sets the subfolder where the protection information is stored. If a subfolder is not set, the file will be saved under the folder choosen above.

Filename- The Filename of the file name where the protection values are stored.

3. "Location Where Random Identifier is Saved"

SubFolder - This sets the subfolder where the protection information is stored. If a subfolder is not set, the file will be saved under the folder choosen above.

Filename- The Filename of the file name where the protection values are stored.

If the subfolder does not already exist, it will NOT be created!

IMPORTANT!!
Be sure to set the folder and file names in such a way that their meaning is not easily understood or inferred from the application name.


PasswordProtect Class

ProtectKit.NET

Newtone.ProtectKit.Win.PasswordProtect Class

The Windows Form PasswordProtect main class

For a list of the members of this class, see Password Protect Members

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Newtone.ProtectKit.Win.PasswordProtect

public sealed class PasswordProtect : System.ComponentModel.Component

Explanation

This class is used to create applications with password protection.

The PasswordProtect class cannot be inherited.

Requirements

Namespace: Newtone.ProtectKit.Win

Assembly: Newtone.ProtectKit.Win.Password.dll

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


PasswordProtect Members

ProtectKit.NET

Newtone.ProtectKit.Win.PasswordProtect Members

PasswordProtect Class

Public Construction
PasswordProtect Constructor Creates a new instance of the PasswordProtect class

Public Properties
Count | Retrieves how many "allowable uses" are remaining
Days | Retrieves how many "allowable days" are remaining
DeviceID | Retrieves the device product number
DllFileName | Sets or retrieves the name of the ProtectKit DLL file
Expiration | Retrieves the expiration date after which the application will no longer run
Months | Retrieves how many "allowable months" are remaining
MonthsType | Determines which day is used as the starting day for protection
PasswordExpiration | Retrieves whether or not the password has an expiration
PasswordType | Retreives the type of password, i.e. whether the password is numeric or alpha-numeric
ProtectWay | Retrieves the way that protection is applied
RegistryKey | Retrieves the root key for the registry where the protection information is saved
RegistrySubkeyRandom | Retrieves the registry subkey where the random number information is saved
RegistrySubkeyStatus | Retrieves the registry subkey where the protection information is saved.
RegistryValueNameRandom | Retrieves the name of the registry value where the random number information is saved
RegistryValueNameStatus | Retrieves the name of the registry value where the protection information is saved
Stream | Sets or retrieves the protection key file content
VendorID | Retrieves the vendor id number
VendorName | Retrieves the vendor name

Public Methods
DeleteRegistry | Deletes protection information from a file or from the registry
Finish | Updates the protection information and finishes the protection process
GetLockword | Retrieves the lockword
Initialize | Starts the protection process
Internet | Connects to the specified URL
QueryCpuID | Retrieves the computer's CPU information
QueryHostBridgeID | Retrieves the computer's motherboard northbridge information
QueryNextPassword | When using passwords with expirations, this method retrieves the next password
QueryNextPcID | When using passwords with expirations, this method retrieves the next PcID
QueryNextRandom | When using passwords with expirations, this method retrieves the next random PC identifier
QueryNicAddressID | Retrieves the PC's network card information
QueryPassword | Retrieves the password set by the SetPassword method
QueryPcID | Retrieves the PcID
QueryPcIDofPassword | Retrieves the "custom created" (user defined) PcID
QueryProtect | Retrieves the current protection status
QueryProtectInformation | Retrieves the protection information
QueryRandom | Retrieves the random PC identifier
QueryRemainCount | Retrieves the number of uses that remain before the application is locked
QueryRemainDays | Retrieves the number of days that remain before the application is locked
QueryRemainMonths | Retrieves the number of months that remain before the application is locked
QueryVideoID | Retrieves the PC's video card information
SendMail | Sends email
SetNextPassword | When using passwords with expirations, this method sets the next password
SetPassword | Sets the password
SetPcIDofPassword | Sets a custom (user defined) PcID

Also See

Newtone.ProtectKit.Win.PasswordProtect


Password Protect Contructor

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect Constructor

This constructor creates a new instance of the PasswordProtect class.

[Visual Basic]
Public Sub New()
Public Sub New(container As IContainer)
Public Sub New(fileName As String)
[C#]
public PasswordProtect()
public PasswordProtect(IContainer container)
public PasswordProtect(string fileName)

Parameters

container
The PasswordProtect container IContainer.

fileName
The name of the ProtectKit DLL.

Explanation

The fileName parameter contains the filename of the ProFuncNET32.dll/ProFuncNET64.dll. If you have renamed these files, pass the new name in this parameter.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


Count property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.Count Property

This property retrieves how many "allowable uses" are remaining (i.e. how many more times the application can be used).

[Visual Basic] Public ReadOnly Property Count As Integer
[C#] public int Count {get;}

Property Value

Read Only

Explanation

The Count property retrieves how many "allowable uses" are remaining. (i.e. how many more times the application can be used). This property will retrieve the "remaining allowable uses" when that type of protection has been applied.

If the Count property is checked before the application program has run then the value retrieved will be the initial value. The Count property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


Days property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.Days Property

This property retrieves how many "allowable days" are remaining (i.e. how many more days the application can be used).

[Visual Basic] Public ReadOnly Property Days As Integer
[C#] public int Days {get;}

Property Value

Read Only

Explanation

The Days property retrieves how many "allowable days" are remaining. (i.e. how many more days the application can be used). This property will retrieve the "remaining allowable days" when that type of protection has been applied.

If the Days property is checked before the application program has run then the value retrieved will be the initial value. The Days property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


DeviceID property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.DeviceID Property

This property retrieves the product number.

[Visual Basic] Public ReadOnly Property DeviceID As Integer
[C#] public int DeviceID {get;}

Property Value

Read Only

Explanation

The DeviceID property retrieves the product number.

The DeviceID property value is set after the QueryHostBridgeID method, the QueryNicAddressID method, or the QueryVideoID method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


DllFileName property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.DllFileName Property

This property sets or retrieves the name of the ProtectKit DLL file This property allows you to rename the ProFuncNET32(64).dll to conceal the fact that your application is being protected.

[Visual Basic] Public ReadOnly Property DllFileName As String
[C#] public string DllFileName {get; set;}

Property Value

The file name of the ProtectKit DLL

Explanation

The DllFileName property sets or retrieves the name of the ProtectKit DLL file. This property allows you to rename the ProFuncNET32(64).dll to conceal the fact that your application is being protected with the ProtectKit.

32bit applications use the ProFuncNET32.dll. 64bit applications use the ProFuncNET64.dll.

If you have changed the names of the ProFuncNET32.dll or the ProFuncNET64.dll, then the new names should be set in this property. ProFuncNET32.dll and ProFuncNET64.dll are the names of these DLL files when the ProtectKit.NET is shipped but you can change the file names to any name that you choose. Please be sure to set the appropriate values in this property before executing the Initialize method.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


Expiration property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.Expiration Property

This property retrieves the expiration date after which the application will no longer run.

[Visual Basic] Public ReadOnly Property Expiration As Integer
[C#] public int Expiration {get;}

Property Value

Read Only

Explanation

The Expiration property retrieves the expiration date after which the application will no longer run. If the Expiration property is checked before the application program has run then the value retrieved will be the initial value.

To set an expiration date of 2009/12/31, for example, set the Expiration property value to 20091231.

The Expiration property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


Months property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.Months Property

This property retrieves how many "allowable months" are remaining (i.e. how many more months the application can be used).

[Visual Basic] Public ReadOnly Property Months As Integer
[C#] public int Months {get;}

Property Value

Read Only

Explanation

The Months property retrieves how many "allowable months" are remaining. (i.e. how many more months the application can be used). This property will retrieve the "remaining allowable months" when that type of protection has been applied.

If the Months property is checked before the application program has run then the value retrieved will be the initial value. The Months property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


MonthsType property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.MonthsType Property

This property determines which day is used as the starting day for protection.

[Visual Basic] Public ReadOnly Property MonthsType As Integer
[C#] public int MonthsType {get;}

Property Value

Read Only

Value | Explanation
0 | Protection starts from the actual date when the application is first executed.
1 | Protection starts from the beginning of the month in which the application was first executed.
2 | Protection starts from the beginning of the month following the month in which the application was first executed.

Explanation

The MonthsType property determines which day is used as the starting day for protection.

For example, if the application is first executed on 2010/03/16 then the following will be the start day for protection:

0: 2010/03/16 is the start day for protection
1: 2010/03/01 is the start day for protection
2: 2010/04/01 is the start day for protection

The MonthsType property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


PasswordExpiration property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.PasswordExpiration Property

This property retrieves whether or not the password has an expiration.

[Visual Basic] Public ReadOnly Property PasswordExpiration As Integer
[C#] public int PasswordExpiration {get;}

Property Value

Read Only

Value | Explanation
false | The password has no expiration
true | The password has an expiration

Explanation

The PasswordExpiration property retrieves whether or not the password has an expiration.

The PasswordExpiration property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


PasswordType property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.PasswordType Property

This property retreives the type of password, i.e. whether the password is numeric or alpha-numeric.

[Visual Basic] Public ReadOnly Property PasswordType As Integer
[C#] public int PasswordType {get;}

Property Value

Read Only

Value | Explanation
0 | The password is numeric. It consists of numerals only.
1 | The password is alpha-numeric. It consists of numerals and alphabetic characters both upper case and lower case.
2 | The password is alpha-numeric. It consists of numerals and alphabetic characters, upper case only.

Explanation

The PasswordType property retreives the type of password, i.e. whether the password is numeric or alpha-numeric.

The PasswordType property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


ProtectWay property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.ProtectWay Property

This property retrieves the way that protection is applied.

[Visual Basic] Public ReadOnly Property ProtectWay As Integer
[C#] public int ProtectWay {get;}

Property Value

Read Only

Value | Explanation
0 | Standard protection: If a password is not entered the application cannot be used at all.
1 | Number of uses protection: The application can be used for the specified number of times. After that, the application cannot be used.
2 | Number of days protection: The application can be used for the specified number of days. After that, the application cannot be used.
3 | Number of months protection: The application can be used for the specified number of months. After that, the application cannot be used.
4 | Date protection: The application can be used until the specified date. After that, the application cannot be used.

Explanation

The ProtectWay property retrieves the way that protection is applied. If the ProtectWay property values are set from 1 through 3, if the PasswordExpiration property is true, a password must first be entered before the application can be used, after that, it will stop working according to which value is set in the ProtectWay property.

The ProtectWay property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


RegistryKey property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.RegistryKey Property

This property retrieves the root key for the registry where the protection information is saved.

[Visual Basic] Public ReadOnly Property RegistryKey As Integer
[C#] public int RegistryKey {get;}

Property Value

Read Only

Value | Explanation
0 | HKEY_CLASSES_ROOT
1 | HKEY_LOCAL_MACHINE\SOFTWARE

Explanation

The RegistryKey property retrieves the root key for the registry where the protection information is saved.

The RegistryKey property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


RegistrySubkeyRandom property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.RegistrySubkeyRandom Property

This property retrieves the registry subkey where the random number information is saved.

[Visual Basic] Public ReadOnly Property RegistrySubkeyRandom As String
[C#] public string RegistrySubkeyRandom {get;}

Property Value

Read Only

Explanation

The RegistrySubkeyRandom property retrieves the registry subkey where the random number information is saved.

The RegistrySubkeyRandom property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


RegistrySubkeyStatus property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.RegistrySubkeyStatus Property

This property retrieves the registry subkey where the protection information is saved.

[Visual Basic] Public ReadOnly Property RegistrySubkeyStatus As String
[C#] public string RegistrySubkeyStatus {get;}

Property Value

Read Only

Explanation

The RegistrySubkeyStatus property retrieves the registry subkey where the protection information is saved.

The RegistrySubkeyStatus property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


RegistryValueNameRandom property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.RegistryValueNameRandom Property

This property retrieves the name of the registry value where the random number information is saved.

[Visual Basic] Public ReadOnly Property RegistryValueNameRandom As String
[C#] public string RegistryValueNameRandom {get;}

Property Value

Read Only

Explanation

The RegistryValueNameRandom property retrieves the name of the registry value where the random number information is saved.

The RegistryValueNameRandom property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


RegistryValueNameStatus property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.RegistryValueNameStatus Property

This property retrieves the name of the registry value where the protection information is saved.

[Visual Basic] Public ReadOnly Property RegistryValueNameStatus As String
[C#] public string RegistryValueNameStatus {get;}

Property Value

Read Only

Explanation

The RegistryValueNameStatus property retrieves the name of the registry value where the protection information is saved.

The RegistryValueNameStatus property value is set after the OueryProtectInformation method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


Stream property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.Stream Property

This property sets or retrieves the protection key file content.

[Visual Basic] Public ReadOnly Property Stream As System.IO.MemoryStream
[C#] public System.IO.MemoryStream Stream {get;}

Property Value

The content of the protection key file.

Explanation

The Stream property sets or retrieves the protection key file content. The content is set into the file that is saved by the protection information setting tool.

Please be sure to set the Stream property value before executing the Initialize method.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


VendorID property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.VendorID Property

This property retrieves the vendor id number.

[Visual Basic] Public ReadOnly Property VendorID As Integer
[C#] public int VendorID {get;}

Property Value

Read Only

Explanation

The VendorID property retrieves the vendor id number.

The VendorID property value is updated whenever the QueryHostBridgeID method, the QueryNicAddressID method, or the QueryQueryVideoID method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


VendorName property

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.VendorName Property

This property retrieves the vendor name.

[Visual Basic] Public ReadOnly Property VendorName As String
[C#] public string VendorName {get;}

Property Value

Read Only

Explanation

The VendorName property retrieves the vendor name.

The VendorName property value is updated whenever the QueryHostBridgeID method, the QueryNicAddressID method, or the QueryQueryVideoID method has been successfully executed.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


DeleteRegistry Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.DeleteRegistry Method

This method deletes protection information from a file or from the registry.

[Visual Basic] Public Function DeleteRegistry As Boolean
[C#] public bool DeleteRegistry();

Return Value

Returns true if successfull, otherwise returns false.

Explanation

The DeleteRegistry method deletes protection information from a file or from the registry.

IMPORTANT: After using the DeleteRegistry method to delete protection information, be sure not to execute the Finish method because it will once again save the protection information to file or to the registry.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


Finish Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.Finish Method

This method updates the protection information and finishes the protection process.

[Visual Basic] Public Function Finish As Boolean
[C#] public bool Finish();

Return Value

Returns true if successfull, otherwise returns false.

Explanation

The Finish method updates the protection information and finishes the protection process.

The Initialize method must be executed before executing the Finish method. If the Initialize method has not been successfully executed, the Finish method is disabled.

How The Finish Method Updates Protection Information:
For example, you run an application that is protected with "Number of Uses" type protection and, when the application is closed, the Finish method is executed. In this case the "remaining number of uses" for that application is decreased by 1. Conversely, if the application is closed and the Finish method is not executed, the "remaining number of uses" for that application does not change. This is what is meant by "the Finish method updates the protection information".

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


GetLockword Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.GetLockword Method

This method retrieves the lockword.

[Visual Basic] Public Function GetLockword As String
[C#] public string GetLockword();

Return Value

Returns the Lockword as a string if successfull, otherwise returns String.Empty.

Explanation

The GetLockword method retrieves the lockword.

The Initialize method must be executed before executing the GetLockword method. If the Initialize method has not been successfully executed, the GetLockword method is disabled.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


Initialize Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.Initialize Method

This method starts the protection process.

[Visual Basic] Public Function Initialize(ByVal applicationName As String, ByVal prtectResDll As String) As Integer
[C#] public int Initialize(string applicationName, string protectResDll);

Parameters

applicationName
The name of the application where protection is applied

protectResDll
The file name where protection information is stored

Return Value

Value | Explanation
-1 | The file set in the DllFileName property is disabled. The calling application and the applicationName parameter are different. The Stream property value has not be set.
0 | Successful
1 | DdScm.exe (DdScm32.exe or DdScm63.exe) has not successfully executed.
2 | Unable to load the file where the protection information is stored.
3 | The application's lockword is not set or is not correct. (The key file must be set in the Stream property)
4 | The application is not running on a local hard disk.
5 | The file where the protection information is stored is incorrect.

Explanation

The Initialize method starts the protection process. This method allows you to reference the protection information.

Before executing the Initialize method, the DllFileName property and the Stream property must be set with the appropriate values.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


Internet Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.Internet Method

This method connects to the specified URL.

[Visual Basic] Public Function Internet(ByVal hWnd As IntPtr, ByVal url As String) As Boolean
[C#] public bool Internet(IntPtr hWnd, string url);

Parameters

hWnd
The window handle
url
The url

Return Value

Returns true if successfull, otherwise returns false.

Explanation

The Internet method connects to the specified URL.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryCpuID Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryCpuID Method

This method retrieves the computer's CPU information.

[Visual Basic] Public Function QueryCpuID() As String
[C#] public string[] QueryCpuID();

Return Value

Returns the CPU information if successful, otherwise returns null [in C#] or Nothing [in Visual Basic].

Explanation

The QueryCpuID method retrieves the computer's CPU ID and name. The Initialize method must be executed before executing the QueryCpuID method. If the Initialize method has not been successfully executed, the QueryCpuID method is disabled.

IMPORTANT: If the QueryCpuID method is used on a PC that is equipped with multiple CPUs, the CPU information retrieved may not be consistent (This is very important if you have set CPU information as a condition for uniquely determining the PC).

The CPU ID will take the following order (Manufacturer Number + 3DNow instruction set support + stepping ID + model + instruction set family + MMX support). Information items are delimited by a hyphen. The number of digits in the CPU ID may vary depending on the CPU.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryHostBridgeID Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryHostBridgeID Method

This method retrieves the computer's motherboard northbridge information.

[Visual Basic] Public Function QueryHostBridgeID() As Boolean
[C#] public bool QueryHostBridgeID();

Return Value

Returns the true if successful, otherwise returns false.

Explanation

The QueryHostBridgeID method retrieves the computer's motherboard northbridge information. The Initialize method must be executed before executing the QueryHostBridgeID method. If the Initialize method has not been successfully executed, the QueryHostBridgeID method is disabled.

After the QueryHostBridgeID method is successfully executed, the retrieved information will be set into the VendorID property, the VendorName property, and the DeviceID property

The motherboard northbridge information contained in the PcID (that was retrieves by the QueryPcID method), consists of the vendor id (4 digits) and the product number (4 digits). These numbers are converted to type String. In general, because the northbridge is attached directly to the motherboard, it is not possible to replace the northbridge as it is to replace the CPU, video card, or network card.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryNextPassword Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryNextPassword Method

When using passwords with expirations, this method retrieves the next password.

[Visual Basic] Public Function QueryNextPassword() As String
[C#] public string QueryNextPassword();

Return Value

Returns the password string if successful, otherwise returns String.Empty.

Explanation

The QueryNextPassword method retrieves the next password. Use this method when you have set passwords that expire. This method will generate the next password. The Initialize method must be executed before executing the QueryNextPassword method. If the Initialize method has not been successfully executed or if passwords without expirations are being used, the QueryNextPassword method is disabled.

The number of digits in the password are determined by the number of digits in the PcID or in the Lockword, whichever is larger.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryNextPcID Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryNextPcID Method

When using passwords with expirations, this method retrieves the next PcID.

[Visual Basic] Public Function QueryNextPcID() As String
[C#] public string QueryNextPcID();

Return Value

Returns the PcID string if successful, otherwise returns String.Empty.

Explanation

The QueryNextPcID method retrieves the next PcID. Use this method when you are using passwords that expire. The retrieved PcID will depend on the settings used in the Set Password Protection tool (PrNETSetProtect.exe). The Initialize method must be executed before executing the QueryNextPcID method. If the Initialize method has not been successfully executed or if passwords without expirations are being used, the QueryNextPcID method is disabled.

For Example:
In the PrNETSetProtect.exe, the PC Identifiers "CPU, Motherboard Northbridge, VideoCard, and NetworkCard must all be different" is selected and
"Add Random Indentifier to these PC Identifiers" has been checked.

In this case, the PcID will be
CPU Information + Motherboard Northbridge Information + VideoCard Information + NetworkCard MAC Address + Random Identifier

For more details, please refer to the QueryCpuID, QueryHostBridgeID, QueryVideoID, QueryNicAddressID methods.

Note: Use the QueryPcID method to get the PcID if the password has already expired. Use the QueryNextPcID method to get the PcID if the password has not yet expired. In this way, you can generate a new valid password and send it to the enduser so that the application can be enabled through the next period (before the application has stopped running).

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryNextRandom Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryNextRandom Method

When using passwords with expirations, this method retrieves the next random PC identifier.

[Visual Basic] Public Function QueryNextRandom() As String
[C#] public string QueryNextRandom();

Return Value

Returns the random string if successful, otherwise returns String.Empty.

Explanation

The QueryNextRandom method retrieves the random PC identifier. Use this method when you have set passwords that expire. This is the random identifier contained in the PcID as retrieved by the QueryNextPcID method.

The Initialize method must be executed before executing the QueryNextRandom method. If the Initialize method has not been successfully executed or if passwords without expirations are being used, the QueryNextRandom method is disabled.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryNicAddressID Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryNicAddressID Method

This method retrieves the PC's network card information.

[Visual Basic] Public Function QueryNicAddressID() As String
[C#] public string QueryNicAddressID();

Return Value

Returns the Mac address as a string if successful, otherwise returns String.Empty.

Explanation

The QueryNicAddressID method retrieves the PC's network card information. The Initialize method must be executed before executing the QueryNicAddressID method. If the Initialize method has not been successfully executed, the QueryNicAddressID method is disabled.

After the QueryNicAddressID method is successfully executed, the Mac address is returned as a string value. Other retrieved information will be set into the VendorID property, the VendorName property, and the DeviceID property

IMPORTANT: When executing this method on a PC that has multiple network cards installed, the retrieved network card information may not be consistant. (When NetworkCard is included in the PC Identifiers). After the application has been unlocked, if it is uninstalled and reinstalled, there is a possiblity that the old password may be able to unlock the application.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryPassword Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryPassword Method

This method retrieves the password set by the SetPassword method.

[Visual Basic] Public Function QueryPassword() As String
[C#] public string QueryPassword();

Return Value

Returns the password as a string if successful, otherwise returns String.Empty.

Explanation

The QueryPassword method retrieves the password set by the SetPassword method. If the protection is not unlocked then the QueryPassword method will fail. The length of the password will be the same number of characters as the length of the lockword or the PcID, whichever is longer.

The Initialize method must be executed before executing the QueryPassword method. If the Initialize method has not been successfully executed, the QueryPassword method is disabled.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryPcID Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryPcID Method

This method retrieves the PcID.

[Visual Basic] Public Function QueryPcID() As String
[C#] public string QueryPcID();

Return Value

Returns the PcID string if successful, otherwise returns String.Empty.

Explanation

The QueryPcID method retrieves the PcID as set by the PrNETSetProtect.exe. The Initialize method must be executed before executing the QueryPcID method. If the Initialize method has not been successfully executed, the QueryPcID method is disabled.

For Example:
In the PrNETSetProtect.exe, the PC Identifiers "CPU, Motherboard Northbridge, VideoCard, and NetworkCard must all be different" is selected and
"Add Random Indentifier to these PC Identifiers" has been checked.

In this case, the PcID will be
CPU Information + Motherboard Northbridge Information + VideoCard Information + NetworkCard MAC Address + Random Identifier

For more details, please refer to the QueryCpuID, QueryHostBridgeID, QueryVideoID, QueryNicAddressID methods.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryPcIDofPassword Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryPcIDofPassword Method

This method retrieves the "custom created" (user defined) PcID.

[Visual Basic] Public Function QueryPcIDofPassword() As String
[C#] public string QueryPcIDofPassword();

Return Value

Returns the PcID string if successful, otherwise returns String.Empty.

Explanation

The QueryPcIDofPassword method retrieves the "custom created" (user defined) PcID set by the SetPcIDofPassword method. The Initialize method must be executed before executing the QueryPcIDofPassword method. If the Initialize method has not been successfully executed, the QueryPcIDofPassword method is disabled.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryProtect Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryProtect Method

This method retrieves the current protection status.

[Visual Basic] Public Function QueryProtect() As Integer
[C#] public int QueryProtect();

Return Value

Value | Explanation
-1 | The file set in the DllFileName property is disabled.
0 | Unlocked
1 | Locked
2 | Number of uses has been exceeded. (For Number of Use Protection only)
3 | Number of days has been exceeded. (For Number of Days Protection only)
4 | Number of months has been exceeded. (For Number of Months Protection only)
5 | The expiration date has been exceeded. (For Expiration Date Protection only)
6 | The PC's clock has been turned back. (For Number of Uses, Days, Months, Expiration Date Protection only)
7 | The running environment (PC) has changed.
8 | The protection information file is incorrect.
9 | The lockword is incorrect.
10 | The password is incorrect.
11 | Other
12 | The protection file is being used incorrectly.

Explanation

The QueryProtect method retrieves the current protection status. The Initialize method must be executed before executing the QueryProtect method. If the Initialize method has not been successfully executed, the QueryProtect method is disabled.

When the return value is 0 and you are using "Number of Uses", "Number of Days", "Number of Months", or "Expiration Date" protection, you can get more detailed information about the protection status by referring to the QueryRemainCount, QueryRemainDays, and QueryRemainMonths methods.

Using password with and without expirations results in different return values.

When using passwords that do not expire with protection types; "Number of Uses", "Number of Days", "Number of Months", or "Expiration Date", when the limits have been exceeded, this method will return values from 2 through 5.

When using passwords that do expire with protection types; "Number of Uses", "Number of Days", "Number of Months", or "Expiration Date", when the limits have been exceeded, this method will return a value of 1.

The return value of 12 usually indicates that the limits of "Number of Uses", "Number of Days", "Number of Months", or "Expiration Date" protection have been exceeded and then the existing protection information file has been overwritten by a different protection file.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryProtectInformation Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryProtectInformation Method

This method retrieves the protection information.

[Visual Basic] Public Function QueryProtectInformation() As Boolean
[C#] public bool QueryProtectInformation();

Return Value

Returns the true if successful, otherwise returns false.

Explanation

The QueryProtectInformation method retrieves the protection information that was set by the PrNETSetProtect.EXE.

The Initialize method must be executed before executing the QueryProtectInformation method. If the Initialize method has not been successfully executed, the QueryProtectInformation method is disabled.

The retrieved information is set into the following properties; Count property, Days property, Expiration property, Months property, MonthsType property, PasswordExpiration property, PasswordType property, ProtectWay property, RegistryKey property, RegistrySubkeyRandom property, RegistrySubkeyStatus property, RegistryValueNameRandom property, and RegistryValueNameStatus property.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryRandom Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryRandom Method

This method retrieves the random PC identifier.

[Visual Basic] Public Function QueryRandom() As String
[C#] public string QueryRandom();

Return Value

Returns a string if successful, otherwise returns String.Empty.

Explanation

The QueryRandom method retrieves the random PC identifier. This is the random identifier contained in the PcID as retrieved by the QueryPcID method.

The Initialize method must be executed before executing the QueryRandom method. If the Initialize method has not been successfully executed, the QueryRandom method is disabled.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryRemainCount Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryRemainCount Method

This method retrieves the number of uses that remain before the application is locked.

[Visual Basic] Public Function QueryRemainCount() As Integer
[C#] public int QueryRemainCount();

Return Value

Value | Explanation
-1 | If the file set in the DllFileName property is disabled. If theQueryProtect method returns a value of 0 (Unlocked) and a password, without an expiration, has been generated and used to unlock the application. If the QueryProtect method returns a value other than 0.
0 or above | The remaining number of uses

Explanation

The QueryRemainCount method retrieves the number of uses that remain before the application is locked. When using "Number of Uses" protection, this method will return the number of uses remaining. For all other types of protection, this method will return -1.

The Initialize method must be executed before executing the QueryRemainCount method. If the Initialize method has not been successfully executed, the QueryRemainCount method is disabled.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryRemainDays Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryRemainDays Method

This method retrieves the number of days that remain before the application is locked.

[Visual Basic] Public Function QueryRemainDays() As Integer
[C#] public int QueryRemainDays();

Return Value

A. If the QueryProtect method returns a value of 0 (Unlocked), this method will return the number of days remaining. If a password (with no expiration) has been generated and used to unlock the application, this method will return -1.

B. If the QueryProtect method returns a value of 1 (Locked), this method will return -1 (a password with an expiration has been used and the number of uses, days, or months has been exceeded.)

C. If the QueryProtect method returns a value of 3, 4, or 5 (The number of uses, days, or months has been exceeded), this method returns the number of exceeded uses, days, or months. (For example: if the number of days has been exceeded by 3, the return value of this method is -3).

D. If the QueryProtect method returns a value other than the values mentioned in A, B, or C above, this method returns -1.

Explanation

The QueryRemainDays method retrieves the number of days that remain before the application is locked. When using "Number of Days", "Number of Months" or "Expiration Date" protection, this method will return the number of days remaining. For all other types of protection, this method will return -1.

The Initialize method must be executed before executing the QueryRemainDays method. If the Initialize method has not been successfully executed, the QueryRemainDays method is disabled.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryRemainMonths Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryRemainMonths Method

This method retrieves the number of months that remain before the application is locked.

[Visual Basic] Public Function QueryRemainMonths() As Integer
[C#] public int QueryRemainMonths();

Return Value

A. If the QueryProtect method returns a value of 0 (Unlocked), this method will return the number of months remaining. If a password (with no expiration) has been generated and used to unlock the application, this method will return -1.

B. If the QueryProtect method returns a value of 1 (Locked), this method will return -1 (a password with an expiration has been used and the number of months has been exceeded.)

C. If the QueryProtect method returns a value of 4 (The number of months has been exceeded), this method returns the number of exceeded months. (For example: if the number of months has been exceeded by 3, the return value of this method is -3).

D. If the QueryProtect method returns a value other than the values mentioned in A, B, or C above, this method returns -1.

Explanation

The QueryRemainMonths method retrieves the number of months that remain before the application is locked. When using "Number of Months" protection, this method will return the number of days remaining. For all other types of protection, this method will return -1.

The Initialize method must be executed before executing the QueryRemainMonths method. If the Initialize method has not been successfully executed, the QueryRemainMonths method is disabled.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


QueryVideoID Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.QueryVideoID Method

This method retrieves the PC's video card information.

[Visual Basic] Public Function QueryVideoID() As Boolean
[C#] public bool QueryVideoID();

Return Value

Returns the true if successful, otherwise returns false.

Explanation

The QueryVideoID method retrieves the vendor number and product number for the video card installed on the PC. The retrieved information is set into the VendorID property, the VendorName property, and the DeviceID property.

The Initialize method must be executed before executing the QueryVideoID method. If the Initialize method has not been successfully executed, the QueryVideoID method is disabled.

The video card information contained in the PcID retrieved by the QueryPcID method consists of the vendor number (4 digits) + the product number (4 digits), converted to a string value.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


SendMail Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.SendMail Method

This method sends email.

[Visual Basic] Public Function SendMail(ByVal mailSeverAddress As String, ByVal fromAddress As String, ByVal fromHeader As String, ByVal toAddress As String, ByVal toHeader As String, ByVal subject As String, ByVal message As String) As Integer
[C#] public int SendMail(string mailSeverAddress, string fromAddress, string fromHeader, string toAddress, string toHeader, string subject, string message);

Parameters

mailSeverAddress
The sending mail server address (SMTP)

fromAddress
The sender's mail address

fromHeader
The sender's name

toAddress
The recipient's mail address

toHeader
The recipient's name

subject
The email subject

message
The email content

Return Value

Value | Explanation
-1 | The file set in the DllFileName property is disabled.
0 | Message Sent
1 | Must have Winsock version 1.1 or above
2 | Unable to find the SMTP mail server
3 | Unable to open mail server socket
4 | Failed to connect to mail server socket
5 | Incorrect or missing parameters
6 | Memory error
7 | Transmission error

Explanation

The SendMail method sends email.

In order to start a new line, you must include code for a new line in your message string.

If using a dial up connection, please be sure you are connected before executing this method.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


SetNextPassword Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.SetNextPassword Method

When using passwords with expirations, this method sets the next password.

[Visual Basic] Public Function SetNextPassword(ByVal password As String) As Boolean
[C#] public bool SetNextPassword(string password);

Parameters

password
The password to be set

Return Value

Returns the true if successful, otherwise returns false.

Explanation

The SetNextPassword method sets the next password. This method is only enabled when using passwords with expirations. This is the password that unlocks the protection for the PC whose PcID is retrieved by the QueryNextPcID method.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


SetPassword Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.SetPassword Method

This method sets the password.

[Visual Basic] Public Function SetPassword(ByVal password As String) As Boolean
[C#] public bool SetPassword(string password);

Parameters

password
The password to be set

Return Value

Returns the true if successful, otherwise returns false.

Explanation

The SetPassword method sets the password. This is the password that unlocks the protection for the PC whose PcID is retrieved by the QueryPcID method.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


SetPcIDofPassword Method

Newtone.ProtectKit.Win

Newtone.ProtectKit.Win.PasswordProtect.SetPcIDofPassword Method

This method sets a custom (user defined) PcID.

[Visual Basic] Public Function SetPcIDofPassword(ByVal pcID As String) As Boolean
[C#] public bool SetPcIDofPassword(string pcID);

Parameters

pcID
The PcID to be set

Return Value

Returns the true if successful, otherwise returns false.

Explanation

The SetPcIDofPassword method sets a custom (user defined) PcID. Use this method if you do not want to use the PcID generated by the QueryPcID method. This method is disabled if a valid password has already been set.

The Initialize method must be executed before executing the SetPcIDofPassword method. If the Initialize method has not been successfully executed, the SetPcIDofPassword method is disabled.

Also See

PasswordProtect Members | Newtone.ProtectKit.Win.PasswordProtect


ProtectKit.NET Sample Programs: It is copy protection for your software. It prevents software theft. It prevents unauthorized copies of your software from running. It stops people from stealing your software. It protects applications from illegal copying and unauthorized use.

ProtectKit.NET

Explanation of .NET Samples

Explanation of the ProtectKit3.5 sample programs for .NET environments:

The ProtectKit3.5 includes the several sample programs for .NET environments. Using these sample programs is a good way to learn how to protect your own applications.

The ProtectKit3.5 sample projects are included in the folder: "\Password Protection\Set Password Protection\For .NET\Sample Programs (.NET)\" under the directory where the ProtectKit3.5 was installed. Below is a list of these sample programs and a brief explanation for each.

CSharp_1 AnyCPU:
This is a C# sample program built with target platform of AnyCPU.
Building this project results in an .EXE called CS_Sample1_AnyCPU.exe.

CSharp_1 Executable applications:
This folder contains the compiled executable applications from the three CSharp_1 samples. These executables files are the builds for each mode; AnyCPU, x64, and x86. See the explanation below "Compiled Executable Applications".

CSharp_1 x64:
This is a 64 bit C# sample program built with target platform of x64.
Building this project results in an .EXE called CS_Sample1_64.exe.

CSharp_1 x32:
This is a 32 bit C# sample program built with target platform of x86.
Building this project results in an .EXE called CS_Sample1_32.exe.

CSharp_2:
This is a C# sample program built with a target platform of "AnyCPU".
Building this project results in an .EXE called CS_Sample2.exe.

VB_1:
This is a VB.NET sample program built with a target platform of "AnyCPU".
Building this project results in an .EXE called VB_Sample1.exe.

VB_2:
This is a VB.NET sample program built with a target platform of "AnyCPU".
Building this project results in an .EXE called VB_Sample2.exe.

IMPORTANT: In all of the above sample projects and programs, the Lockword used is "AbcdefgH". This Lockword is set in the Stream Property of the PasswordProtect Class located in each project's form.

How to build the samples:

Open a sample project in Visual Studio and rebuild the project. You may get the following error....

The type or namespace name 'Newtone' could not be found (are you missing a using directive or an assembly reference?)"

If you do, copy the Newtone.ProtectKit.Win.Password.dll into the project's bin folder and try rebuilding the project again. We have provided a .NET Framework 2 version and a .NET Framework 4 version of this DLL. Please use the appropriate Newtone.ProtectKit.Win.Password.dll depending your version of Visual Studio.

How to run the samples:

To run an EXE built from these projects, copy the ProtectKit's ProFuncNET32(64).dll and the ProInfo32(64).dll into the same folder as the EXE.
Also copy the Newtone.ProtectKit.Win.Password.dll into the same folder as the EXE. There are two versions of this DLL, one for .NET Framework 2.0 and another for .NET Framework 4.0. Please be sure to copy the appropriate DLL.

After you have copied these files, run the Set Password Protection tool (PrNETSetProtect.exe) and set the appropriate protection information in to the ProInfo32(64).dll. The Set Password Protection tool will also create a .dat file (ProInfo32(64).dll.dat) that you must embed in your .NET application as a resource. If you change the Lockword, you will need to embed the .dat file in the Stream property of the PasswordProtect class and in the appropriate place in the code, change "AbcdefgH" to the value you want and build the project.

For more information about that, please see step #2 and #3 in Password Protection: Example For .NET Apps.

Compiled Executable Applications

For convenience, the three CSharp_1 sample programs have been compiled and their executable applications included in a folder called CSharp_1 Executable applications. These executables files are the builds for the above CSharp_1 sample programs for each mode; AnyCPU, x64, and x86.

IMPORTANT: We have used an obfuscating tool (Spices.NET) to obfuscate these runtime applications (exe). Obfuscating your application prevents tools like the Reflector from being used to decompile your application. BE SURE to obfuscate your .NET programs and encrypt strings so that your lockword remains secret.

The compiled executable applications are listed below with a brief explanation for running the app.

CS_Sample1_AnyCPU.exe
CS_Sample1_64.exe
CS_Sample1_32.exe

AnyCPU: CS_Sample1_AnyCPU.exe

This application is built in "AnyCPU" mode. It will run as a 32 bit application on a Windows x86 (32 bit) OS. It will run as a 64 bit application on a Windows x64 (64 bit) OS.

The following files should be copied into the same folder as the EXE:
ProInfo64.dll, ProInfo32.dll
ProFuncNET64.dll, ProFuncNET32.dll
Newtone.ProtectKit.Win.Password.dll

x64: CS_Sample1_64.exe

This application is built in "x64" mode. It will run as a 64 bit application on a Windows x64 (64 bit) OS. It will not on a Windows x86 (32 bit) OS.

The following files should be copied into the same folder as the EXE:
ProInfo64.dll
ProFuncNET64.dll
Newtone.ProtectKit.Win.Password.dll

x86: CS_Sample1_32.exe

This application built in "x86" mode. It will run as a 32 bit application on a Windows x86 (32 bit) OS. It will run as a 32 bit application on a Windows x64 (64 bit) OS but must run on WOW64.

The following files should be copied into the same folder as the EXE
ProInfo32.dll
ProFuncNET32.dll
Newtone.ProtectKit.Win.Password.dll

Explanation of the Sample Applications:

The following labels and buttons appear in the sample program.

A. Protection Type:
Shows the type of protection that was set using the "Set Password Protection" tool.

B. Protection Status:
Shows the current protection status; i.e. whether the application is locked, unlocked, etc.

C. Remaining Uses:
Shows the number of times that the application can be used. This is applicable when "Number of Uses" type protection is used.

D. Remaining Days:
Shows the number of days that the application can be used. This is applicable when "Number of Days" type protection is used.

E. Remaining Months:
Shows the number of months that the application can be used. This is applicable when "Number of Months" type protection is used.

F. Expiration Date:
Shows the date after which the application can not be used. This is applicable when "Expiration Date" type protection is used.

G. VideoCard:
Shows the video card information of the PC running the EXE.

H. Motherboard:
Shows the motherboard information of the PC running the EXE.

H. LAN card:
Shows the LAN card information of the PC running the EXE.

J. Random Numbers:
Shows any random numbers that have been set in the protection information This will not show anything if random numbers are not being used.

K. CPU:
Shows the CPU information of the PC running the EXE.

L. GET PcID (Default):
This retrieves the default PcID of the PC running the EXE. This is the default PcID information.

M. SET PcID (User Specified):
This sets the user specified PcID for the PC running the EXE.

N. GET PcID (User Specified):
This retrieves the current valid PcID, whether a default PcID or a user specfied PcID.

O. Set Password:
This sets the password needed to unlock the application.

P. Remove Registry Information:
This deletes the protection information that has been set in the registry.

Improving Security

To improve the strength of your protection we recommend the following:

1. Obfuscate your .NET applications. Tools like the "Reflector" are able to decompile .NET assemblies and expose your passwords. lockwords, and program code. When obfuscating your program, be sure to encrypt strings. This will help to keep your lockword secret.

2. Rename the ProInfo32.dll, ProInfo64.dll, ProFuncNET32.dll, and ProFuncNET64.dll files. Renaming the ProtectKit DLL files will make it harder for hackers to know how you have protected your applications with the ProtectKit.

Regarding the ProInfo64.dll ProFuncNET64.dll

The ProInfo64.dll, ProFuncNET64.dll are DLLs for 64 bit applications. If you are running a 32 bit application on a 64 bit operating system, you need to use the ProInfo32.dll and ProFuncNET32.dll.


How to Run the .NET Samples

The sample programs included with the ProtectKit3.5 are intended to illustrate how you can use Password Protection in your own .NET applications. The ProtectKit.NET samples call various ProtectKit.NET functions to retrieve information and set protection. Using these sample programs is an excellent way to understand how password protection works and how to add it to your .NET applications

The following is a brief explanation of how to set password protection and also how to unlock that protection.

Step 1. Setting protection with the Set Password Protection Tool (PrNETSetProtect.exe).

Choose a sample program and open the sample project. Build an EXE.

Step 2. Copy necessary ProtectKit.NET files

Copy the necessary ProtectKit.NET files into the same folder as the EXE. (These ProtectKit.NET files are: ProInfo32(64).dll, ProFuncNET32(64).dll, and Newtone.ProtectKit.Win.Password.dll)

Step 3. Set Protection

a. Run the "Set Password Protection" tool (PrNETSetProtect.exe).
b. Click the "Open" button.
c. Choose the ProInfo file. This is the ProtectKit3.5 ProInfo32(64).dll that you copied to the same folder as your EXE.
(This file can be renamed for increased security.)
d. Select the PC Identifiers that you want to use to uniquely identify the PC running your application.
e. Set a lockword and protection type. For example:
Lockword: AbcdefgH
Protection Type: Standard Protection
f. Click the "Save" button at the top of the "Set Password Protection" tool.

Two files will be created:
1. The ProInfo file, (default name is ProInfo32.dll) has been overwritten to include the protection information you set using the Set Password-Type Protection tool.
2. The protection resource file. (default name is ProInfo32.dll.dat). This file is to be embedded into your application and the application EXE rebuilt. See next step

Step 4. Embedding the protection information into your application.

There are two ways to embed the protection resource file into your application.
1. Embed protection resource using the PasswordProtect.Stream property.
a. Open the application's project in Visual Studio.
b. Locate the PasswordProtect class
c. In the Property Window, click the Stream property and set the protection resource file (default name is ProInfo32.dll.dat) into the stream property.
(The ProInfo32.dll.dat file can be renamed for greater security)
d. Rebuild the project.
e. The protection information has now been embedded into your application.
2. Embed protection resource as a resource file
a. Open the application's project in Visual Studio.
b. Add the ProInfo32.dll.dat file to your project: in the Solution Explorer, right click on the project and select ("Add an existing item")
c. In the Solution Explorer, click on the newly added ProInfo32.dll.dat file and in the Properties Window, set the Build Action to "Embedded Resource".
d. Rebuild the project.
e. The protection information has now been embedded into your application.

Run the sample EXE and check the protection status by clicking the button named "Protection Status". The status is "Locked".

II. Unlock the application

To unlock an application, you need to enter a valid password. Passwords are generated by the Password Generators. Here we will use the Password Generator EXE (Pr3PassGen.exe). To use the password generator, you must first retrieve the PcID from the PC. The sample programs retrieve the PcID within a button click event. Run the sample EXE that you protected in the above steps and click the button named "Get PcID (default)". The PcID will appear in the textbox.

Run the Password Generator (Pr3PassGen.exe).
Enter the lockword: AbcdefgH
Enter the PcID that you retrieved from the sample Exe.
Click the button named "Retrieve Password". The password will appear in the textbox.
Copy it from the Password Generator and paste it into the appropriate textbox in the sample EXE and click the button named "Set Password".

The sample Exe should be now be unlocked. Confirm this by clicking the button named "Protection Status".

III. Runtime environment:

The sample EXE file and the following files MUST be in the same folder:
ProInfo32(64).dll
ProFuncNET32(64).dll
Newtone.ProtectKit.Win.Password.dll

If you are trying to run the sample on a target machine where the ProtectKit3.5 installation program was not used, you will need to be sure that the ProtectKit System Driver is installed and working on that machine. To install it, run the Ddscm.exe. For details see Options for Ddscm.exe.


HowToRunNETSamples

ProtectKit.NET

How To Run .NET Samples

The following is a step by step explanation for running one of the password protection .NET sample projects. By following these steps you will be able to run all the .NET samples and also understand how to add password protection to your own applications.

.NET Password Protection Sample "CSharp_1 AnyCPU"

The following is an explanation of the .NET sample program called "CSharp_1 AnyCPU". It can be found in the following default Installation location:

C:\Program Files\ProtectKit3.5\Password Protection\Set Password Protection\For .NET\Sample Programs (.NET)\CSharp_1 AnyCPU\

For this explanation, I am using a Windows 7 32bit operating system. If running on a 64 bit operating system, your paths may be slightly different, though nothing that should cause confusion. I wanted to keep the sample programs that shipped with the ProtectKit3.5 in original condition so I created a new folder called "Run Pro35 Samples" at

"C:\Run Pro35 Samples\"

and then copied the ProtectKit3.5 sample project that I wanted to run into this folder.

Step 1:

Copy the entire "CSharp_1 AnyCPU" folder from the installation location given above into the test folder. In my case that is the "C:\Run Pro35 Samples" directory. Building this project will result in an EXE file called "CS_Sample1_AnyCPU.exe". I will be building this project in debug mode so the CS_Sample1_AnyCPU.exe will be created in the following directory:

"C:\Run Pro35 Samples\CSharp_1 AnyCPU\bin\Debug\"

Step 2:

Copy the necessary ProtectKit3.5 files into the same directory as the EXE file. This sample will be built with a target platform of "AnyCPU" and will be able to run in either 32bit or 64bit operating systems. Therefore, you will need to copy the protection information files (ProInfo files) for both 32bit and 64bit applications. Copy the ProInfo32.dll and ProInfo64.dll files into the same directory as the CSharp_1 AnyCPU.exe. You will find these ProtectKit3.5 protection information files in this default installation directory:

C\Program Files\ProtectKit3.5\Password Protection\ProInfo Files\

Note: The ProInfo32.dll is for 32 bit applications, whether they are running on a 32 or 64 bit operating system. The ProInfo64.dll is for 64 bit applications. The ProInfo32(64).dll files are the same for .NET applications or Win32(64) applications.

Next, copy the ProFuncNET32.dll, ProFuncNET64.dll, and Newtone.ProtectKit.Win.Password.dll files into the same directory as the EXE file. The ProFuncNET32(64).dll files and Newtone.ProtectKit.Win.Password.dll file can be found in this default installation directory:

C:\Program Files\ProtectKit3.5\Password Protection\Set Password Protection\For .NET\ProFunc Files (.NET)\

Note: The ProFuncNET32.dll is for 32 bit applications. The ProFuncNET64.dll is for 64 bit applications. There are two Newtone.ProtectKit.Win.Password.dll files, one for .NET Framework 2.0 and another built for .NET Framework 4.0. Which Newtone.ProtectKit.Win.Password.dll you use will depend on the .NET framework your application is built with.

The ProFuncNET32(64).dll files CANNOT be used with Win32(64) native applications.

Step 3:

Open the project in Visual Studio.
Rebuild the CS_Sample1_AnyCPU.exe
Close the project.

Step 4:

Set Protection:

1. Open the Set Password Protection Tool for .NET applications. This tool is called "PrNETSetProtect.exe" and can be found in this default installation location:

C:\Program Files\ProtectKit3.5\Password Protection\Set Password Protection\For .NET\Set Password Protection Tool (.NET)\PrNETSetProtect.exe

2. Click the "Open" button, and browse to the ProInfo files that you copied above. They should be in the same directory as the CS_Sample1_AnyCPU.exe you have just built. In my case that is here:
"C:\Run Pro35 Samples\CSharp_1 AnyCPU\bin\Debug\"

3. Select one of the ProInfo files. If your application is a 32 bit application, use the ProInfo32.dll. If your application is a 64bit application, use the ProInfo64.dll. In this case, the application is AnyCPU so we will need to set protection information into both the ProInfo32.dll and the ProInfo64.dll. We will start by choosing the ProInfo32.dll.

4. Next, choose the PC Indentifiers you want to use. This determines how strictly you want to define the computer's hardware signature. I am accepting the default setting which is the least restrictive.

5. Choose a Lockword. The trial version of the ProtectKit3.5 requires that you use the Lockword "AbcdefgH". I will use this also. In your applications you should choose a different lockword and keep it secret. The lockword must consist of English alphabet (a through z, both lower and upper case) and/or numbers 0 through 9. The lockword must contain at least 8 characters and cannot exceed 64 characters.

6. Choose the Protection Type. Here I am choosing Standard protection which means the application will be locked initially until it is unlocked with a password. Once unlocked, it will run indefinitely.

7. Complete these protection setting by clicking the Save button at the top. A messagebox will appear telling you that the protection has been set. The Set Password Protection tool will add the protection information into the ProInfo32.dll. It will also create another file called ProInfo32.dll.dat whose path is shown. You will embed this file into your application. It is this one to one correspondence between the protection information in ProInfo file and the protection information embedded in the application that enables password protection. Instructions for embedding the ProInfo32.dll.dat file into the application are given below.

8. Before we can embed the protection information into the application, we must repeat the above steps 3 through steps 7 for the ProInfo64.dll. This will set protection information when the application runs as a 64 bit application. Repeating steps 3 through 7 for the ProInfo64.dll will result in the creation of another file called ProInfo64.dll.dat.

NOTE: You can change the name of the ProInfo32.dll file if you want to. You do this by using the Save As button. The New button is essentially the same as the Open button. If you use the Open button with an existing ProInfo32(64).dll, the Set Password Protection Tool will ask you for the Lockword. If you use the New button, it will delete all existing protection settings and start over. The results are essentially the same.

Here is a screenshot of the Set Password Protection Tool with the above settings.

For more details please refer to the explanation for the Set Password Protection Tool For .NET Applications.

Step 5:

Embedding the protection information into the application. After you have used the Set Password Protection Tool a file will be created that you need to embed in your application. Because this application is built in AnyCPU, we have set protection information into the ProInfo32.dll and the ProInfo64.dll files. Two other files, the ProInfo32.dll.dat and the ProInfo64.dll.dat were created. CHOOSE ONE OF THESE FILES to embed in your application. It doesn't matter which one you choose. There are two ways to do this....

1. Open your application project, select the PasswordProtect class. In the Properties window, click on button at the right of the Stream property and set the path to the embedded protection file. (see images below)

Click the "Open" and the ProInfo32.dll.dat file will be embedded into the application.

2. The other way to embed the ProInfo32.dll.dat file into your application is to open your application project and add the ProInfo32.dll.dat to your project. Then in the Properties Window, set the file's build action to "Embedded Resource". .

Once you have done this, rebuild your application.

Step 6:

You have now set protection into the application. Try running it. Double click on the CS_Sample1_AnyCPU.exe. You should see something like this....

At the top, the Initial Status should say, "OK". This means that the ProtectKit System Driver is properly installed and running, that the ProInfo and ProFuncNET files are where they should be, that the protection information embedded in the application matches that set in the ProInfo file and so on. If you are getting some errors here then see the trouble shooting section.

Click the Protection Type button: It should say "Standard protection"
Click the Protection Status button: It should say, "Locked"

The other buttons, "Remaining Uses", "Remaining Days", and "Remaining Months" pertain to different protection types and are not relevant. Clicking them will return values of -1.

You can also retrieve the hardware information with this application by clicking the "Video Card", "Motherboard", "LAN Card", "Random Number", and "CPU" buttons. This information is used to create the default Pcid that indentifes the computer running this application.

Here is a screenshot showing this information:

Notice that this application is locked. To unlock the application, you need to retrieve the PcID and enter it into the Password Generator. The ProtectKit3.5 has three ways to generate passwords. In this example we will use the Pr3PassGen.exe. It can be found in the following deflault directory:

C:\Program Files\ProtectKit3.5\Password Protection\PasswordGenerators

Also in this directory, besides the Pr3PassGen.exe, you will see a Pr3PassGen.dll and Pr3PassGen.ocx. These two programable password generating intefaces let you send unlock passwords to your endusers programatically.

1. Double click the Pr3PassGen.exe.
2. Enter the Lockword, which in our case is: AbcdefgH
3. Copy the PcID from the application...To retrieve it click the GetPcID (default) button.
4. Click the Generate Password button
5. Copy the Password from the Password Generator and paste it into the application in the textbox next to the Set Password button.
6. Click the Set Password button.

This will unlock the application. To check that. Click the Protection Status button again.

The application has now been unlocked and will run indefinitely on this machine. If it is copied to another computer it will stop running.

Please try out other protection types using this sample project.

TroubleShooting:

When this application starts up, under the Form Load event, the passwordProtect1.Initialize method executes. This method starts the Protectkit3.5 and tells you that:

1. The ProtectKit System Driver is working properly.
2. The protection information in the application matches the protection information in the ProInfo32(64).dll.
3. The lockword has been retrieved from the protection information and it has passed the check.
4. The application is running on a local drive.
5. There are no other errors.

If you get a messagebox saying this, "ProtectKit isn't working."
That means the ProtectKit System Driver is not working. This system driver is installed on the computer where you installed the ProtectKit3.5. For details about this system driver please refer to the "ProtectKit System Driver" explanation in the help file of visit our online help here: ProtectKit System Driver

If you have deployed this exe to another computer then you will need to install the ProtectKit System Driver there by executing the Ddscm.exe on that computer. You will also need to do this with your own application when you deploy it. Please refer to the explanation of the ProtectKit System driver mentioned above and to Options For DdScm.exe in the help file or here: Options For DdScm.exe

If you get a messagebox saying this, "Unable to read protection information file."
That means the ProInfo32(64).dll file is not in the same directory as the application's exe file.

If you get a messagebox saying this, "Lock word is incorrect."
The lockword retrieved from the protection information embedded in your application is either incorrect or it hasn't been set yet. This can happen if you have recompiled your EXE without resetting protection using the Set Password Protection Tool. For details about how to set protection see: Set Password Protection Tool for Win32(64)

If you are getting other types of errors, be sure that the Newtone.ProtectKit.Win.Password.dll is in the same directory as the EXE and that it is the proper .NET Framework version.


Target Platform

ProtectKit.NET

Target Platform for Password Protected .NET Applications

Target Platform for Password Protected .NET Applications

The ProtectKit.NET assembly Newtone.ProtectKit.Win.Password.dll is built with a target platform of AnyCPU. This allows you to protect both 32 bit and 64 bit applications.

If you have choosen to build your application with at target platform of AnyCPU, then there are some important considerations when deploying to a 32 bit operating system or to a 64 bit operating system.

For applications running on a 32 bit Operating System

The DllFileName property allows you to rename the ProFuncNET32.dll in order to conceal the fact that your application is being protected. You must be sure to set the name of the ProFuncNET32.dll (either "ProFuncNET32.dll" or the name of this dll if you have renamed it) into the protectResDll parameter of the Initialize method.

For applications running on a 64 bit Operating System

The DllFileName property allows you to rename the ProFuncNET64.dll in order to conceal the fact that your application is being protected. You must be sure to set the name of the ProFuncNET64.dll (either "ProFuncNET64.dll" or the name of this dll if you have renamed it) into the protectResDll parameter of the Initialize method.

Examples for Enabling Protected Applications with a Target Build of AnyCPU

Building your protected application with a target platform of AnyCPU allows the application to run as a 32 bit application on a 32 bit OS and as a 64 bit application on a 64 bit OS.

A. Application code switches files:
Depending on whether your protected application is running on a 32 bit OS or a 64 bit OS, your application code changes the file set in the DllFileName property and the protectResDll parameter of the Initialize method.

B. Install the appropriate files when your protected application is installed:
Place the necessary files for enabling protection on 32 bit operating systems (ProFuncNET32.dll, ProInfo32.dll, etc.) in one folder and the necessary files for enabling protection on 64 bit operating systems (ProFuncNET64.dll, ProInfo64.dll, etc.) in another folder. Structure your installation routine to install the correct files depending on whether the installation is executed on a 32 bit machine or a 64 bit machine.

Examples for Enabling Protection on Applications with a Target Build of (x86) or (x64)

When the target platform is set to (x86) or (x64) it is quite simple because it is only necessary to copy the appropriate files for enabling protection for that operating system. In other words, there is no need to "switch" files because the protected application will only run on a single target platform.


Deploying .NET Applications

ProtectKit.NET

Deploying Applications

How to deploy your protected .NET applications:

When deploying applications containing ProtectKit.NET functionality, the following files must be deployed with the application.

For 32-bit applications

1. Newtone.ProtectKit.Win.Password.dll (ProtectKit.NET assembly)
2. ProFuncNET.dll (the ProtectKit.NET password protection function DLL). For added protection, it is recommended that you rename this file.
3. ProInfo32.dll (the file where protection information is stored). For added protection, it is recommended that you rename this file. To rename the ProInfo32.dll file, use the Set Password Protection tool (ProtectKit.NET) and choose the "Save As" option.
4. DdScm32.exe or the DdScm64.exe (which file will depend on the operating system environment where the application is to be installed. The DdScm32(64).exe must be registered.

If you are not sure of the operating system environment (whether 32 bit or 64 bit OS) then deploy all three files DdScm.exe, DdScm32.exe, and DdScm64.exe. (Internally, the DdScm.exe will determine the operating system and execute the proper program). In this case, the DdScm.exe, must be registered. For details about registering DdScm.exe, DdScm32.exe, or DdScm64.exe, see Options for DdScm.

For 64-bit applications

1. Newtone.ProtectKit.Win.Password.dll (ProtectKit.NET assembly)
2. ProFunc64.dll(the ProtectKit.NET password protection function DLL). For added protection, it is recommended that you rename this file.
3. ProInfo64.dll (the file where protection information is stored). For added protection, it is recommended that you rename this file. To rename the ProInfo64.dll file, use the Set Password Protection tool (ProtectKit.NET) and choose the "Save As" option,
4. DdScm64.exe.The DdScm64.exe must be registered. For details about registering DdScm64.exe, see Options for DdScm.

When the above files are deployed, they must be copied to the same folder. You cannot run a protected application on FD or DVD(CD)-ROM, remote network drive, etc. The ProtectKit will only run on local hard disk. It will not run on the drive's root directory. Also, please avoid copying to certain folders that, depending on Windows user permissions, do not have write permission like Windows System folder.
Although the ProtectKit.NET assembly is strong named, do not register it in the Global Assembly Cache (GAC).

The files that you should deploy also depend on the target platform of your application. For more information about how to deploy your protected application with build options AnyCPU, x86, and x64, please refer to Target Platform

Files That Cannot Be Distributed

The following files cannot be distributed under any circumstances.

PrNETSetProtect.exe (Set Password Protection Tool) 32/64 bit
Pr3PassGen.exe (Password Generator EXE) 32/64 bit
Pr3PassGen.dll (Password Generator DLL) 32/64 bit
Pr3PassGen.ocx (Password Generator OCX) 32/64 bit


Important Considerations For Password Protected Applications

Special Considerations When Using Password Protected Applications

The following are some things that you need to consider when using password protected applications.

Keep the lockword secret

Your protection will be compromised if you do not keep your lockword secret. This is the lockword that you set in the Set Password Protection Tool.

Because strings are often visible when compiled EXE files are opened in text editors or with dump tools, be sure to seperate the characters in your lockword check string so that they are harder to recognize in a dump file. You should do the same thing when you create the lockword.

For example:
ChkLockword = "A" & "b" & "c" & "d" & "e" & "f" & "g" & "H"

Building up your lockword string and lockword check in this way will make it harder for someone to discover it by opening your compiled EXE file in text editors or dump tools. Be sure to obfuscate your .NET assemblies and encrypt the strings. This is very important. The .NET CRL (Common Runtime Language) is easily decompiled and wholly visible. Even obfuscated, strings will still be visible. Be sure to encrypt them.

Your protected application and the protection information file

There is a one to one correspondence between the protection information stored in your application and the protection information stored in the protection information file. If multiple protected applications are distributed, each protected application must have its own protection information file.

Registering and Deleting the ProtectKit System Driver

The ProtectKit3.5 uses a system driver to enable password protection on the PC where the protected application runs. The DdScm.exe, DdScm32.exe, and DdScm64.exe install this system driver and enable the protected application to use the ProtectKit in the runtime environment. Before a protected application will work, the DdScm.exe, DdScm32.exe, and DdScm64.exe must be executed on the PC where the protected application is deployed. For details about the DdScm, see Options for DdScm.

When using the DdScm.exe, make sure that DdScm32.exe and/or DdScm64.exe are present in the same folder as DdScm.exe.

Options for registering and deleting DdScm.exe, DdScm32.exe, and DdScm64.exe service. For details about the DdScm, see Options for DdScm
To register DdScm.exe execute - DdScm.exe /a
To delete DdScm.exe execute - DdScm.exe /r
To register DdScm32.exe execute - DdScm32.exe /a
To delete DdScm32.exe execute - DdScm32.exe /r
To register DdScm64.exe execute - DdScm64.exe /a
To delete DdScm64.exe execute - DdScm64.exe /r

Registering the DdScm service
When building the installer for your application, before the "Installation Completed" dialog is displayed, be sure to add the install scripts [DdScm.exe /a], [DdScm32.exe /a], and [DdScm64.exe /a]. If not running install scripts to register the DdScm service at the time of installation, then this service should be registered manually directly after installation (Under Administrator Permissions). It is the DdScm.exe that provides the necessary services for running the ProtectKit in the runtime environment so this MUST be done on the PC where your protected application is deployed. (On your development machine where you installed the ProtectKit3.5 (ProtectKit3 and ProtectKit.NET), this service was registered when the ProtectKit3.5 was installed. By default, this service will startup automatically so if Windows is reset or shutdown, the DdScm service will automatically start up when Windows starts up.

Deleting the DdScm service
When your application is uninstalled, be sure to execute the commands to remove the DdScm service [DdScm.exe /r], [DdScm32.exe /r], [DdScm64.exe /r]. Add the scripts to uninstall this service at the beginning of your applications "Uninstall Program". If you are not writing the scripts to remove the DdScm service in your Uninstall Program, then be sure to execute the commands; [DdScm.exe /r], [DdScm32.exe /r], [DdScm64.exe /r], manually under Administrator permissions directly after your Uninstall Program finishes.

When re-deploying your application: There are times when you may need to update your protected application by re-deploying a new EXE. At this time, the protection information is already enabled on the enduser's PC. It is not necessary to deploy a new protection information file with you new EXE. If you deploy a new protection information file with the new EXE, then your application will be locked and must be unlocked with a new password.


Password Protection Example For Win32(64). It is copy protection for your software. It prevents software theft. It prevents unauthorized copies of your software from running. It stops people from stealing your software. It protects applications from illegal copying and unauthorized use.

ProtectKit3

Password Protection: Example For Win32(64) Apps

It is easy to set protection in your applications.

Set protection with a few simple steps:
Step 1: Set ProtectKit code in your application.
Step 2: Set protection information using the "Set Password Protection Tool".
Step 3: Digitally sign your application if desired.
Step 4: Deploy Application.
Step 5: Generate a password and send it to the user.

Win32 (Win64) Example: (in Visual Basic)

Step 1: Set ProtectKit code in your application code

Initializing the ProtectKit3.5 in the Form Load event:

Private Sub Form_Load()
Dim LockWord As String * 9
Dim ChkLockword As String
Dim LockwordLen As Long
.
ret = PK3Initialize("Project1.exe",
                    "ProInfo.dll")
If ret <> 0 Then
If ret = 1 Then
                    Msg= "Unable to run application."
If ret = 2 Then
                    Msg= "Unable to load protection information file."
If ret = 3 Then
                    Msg= "The lockword is incorrect."
.
End
End If

LockwordLen = PK3GetLockword(LockWord)
ChkLockword = "Ab" & "cd" & "ef" &
                    "gH"
If LockwordLen <> 8 Or ChkLockword <>
                    Left(Lockword, LockwordLen) Then
End
End If
End Sub

Retrieve the PC's Hardware Signature (PcID)

Private Sub Command1_Click()
Dim str As String * 65
Dim strLen As Long
...
ret = PK3QueryPcID(str, strLen)
Text2.Text = str
...
End Sub

Set the Password

Private Sub Command2_Click()
ret = PK3SetPassword(Text1.Text)
End Sub

Check Protection Status

Private Sub Command3_Click()
ret = PK3QueryProtect()
If ret = 0 Then Msg = "Application is unlocked."
If ret = 1 Then Msg = "Application is locked."
If ret = 2 Then Msg = "Exceeded allowable number of uses."
.
End Sub

Step 2: Set protection information

Use the Set Password Protection tool to set protection information into your application:

This tool writes protection information into a "protection information file" and also embeds the same information into your compiled application.

Step 3: Digital signature

If you are digitally signing your application, do that at this step. If you are not digitally signing your application, proceed to Step 4.

Step 4: Deploy your application

Deploy your application and all its associated files to the target machine.

Step 5: Generate the password and notify the user

The Password Generator

The ProtectKit3.5 provides several ways to generate passwords. The runtime Password Generator (EXE) allows you to enter a lockword and a PcID and generate a password manually. For example, using the lockword from Step 2 and the PcID retrieved from the user's PC, you can generate a password, which you send to the enduser so that they can unlock the application.

Password Generator EXE

Password Generator OCX and DLL

These files provide the password generating functions in a useful API. This API allows you to generate passwords programmatically from the lockword and retrieved PcID and to send the passwords to your users.

Below is an example of a web application that uses VBScript code to to generate a password.

Set objCOM = Server.CreateObject("Pr3PassGen.PassGen")
objCOM.LockWord = varLockword
objCOM.PCID = varPCID
objCOM.PasswordType = varType
varUnlockword = objCOM.PS3GetPassword
Set objCOM = nothing

Here is Visual Basic code that uses the EMail API

ret = PS3SendMail("msv.newtone.co.jp", "info@newtone.co.jp", _
"NEWTONE", "paul@company.com", "Users", _
"PassWord Information", "Below is the password needed to unlock....")


Features

ProtectKit3

Set Password Protection tool for Win32(64)

Set Password Protection Tool

The "Set Password Protection" tool sets the password protection into your applications. It allows you to choose the type of password protection and all other protection settings that you need in order to password protect your applications. The "Set Password Protection" tool writes all protection information into a special protection information file (the ProInfo file). It also embeds the protection information into your application.

It is this one to one correspondence between the protection information file and the protection information embedded in your application that enables protection. Depending on the type of password protection that you have chosen, protection information may also be written to the registry and to a separate file. The location in the registry, the registry key and value, where the protection information is written and the location in the file system where the protection information is saved to file is specified by you when you use the "Set Password Protection" tool.

Set Password Protection Tool Contents:

The following items are important when setting password protection in Win32(64) applications:

Protection Information Files
ProInfo Files
Application File to be Protected

Protection Settings:
PC Identifiers
Lockword
Types of Passwords
Standard Protection
Number of Uses Protection
Number of Days Protection
Number of Months Protection
Expiration Date Protection
Renewable Passwords
Password Configuration
Registry Settings
File Settings


Set Password Protection Tool: ProInfo File

ProInfo File:

This is the file used by the ProtectKit3 to store the protection information. By default it is called "ProInfo32.dll" or "ProInfo64.dll" but may be renamed to conceal that the ProtectKit3 is being used.

In the screenshot of the Set Password Protection tool below, we are using Standard Password Protection with default settings. To start, you click the "Open" button and choose the ProInfo file that you will use to save protection settings. This is shown below in red.

After choosing the ProInfo file where you will save the protection information, you choose the application file you would like to protect. The Set Password Protection tool will embed the protection information in this application. It is this one to one correspondence between the protection information set in the ProInfo file and the protection information embedded in your application that enables protection. For details about embedding the protection information into your Win32(64) application, please see Step #2 in Password Protection: Example For Win32(64) Apps.

After you have chosen the all appropriate protection settings, you can click the Save or the SaveAs buttons. The Save button will save the ProInfo file and protected application file in the locations shown. The SaveAs button will allow you to rename the ProInfo file, which is recommended for increased security.


Set Password Protection Tool: Application File to be Protected

Application File to be Protected:

This is the application file that will be protected by password protection. The Set Password Protection tool writes protection information into this application file. The same protection information is stored in the ProInfo file.

To select the application file that you want to protect, click on the Folder Icon to the right of the text box, indicated in red in the screenshot below. After choosing the application file that you want to protect, the path to the application file will appear in the textbox.

After you have chosen the appropriate protection settings, you click the Save or the SaveAs buttons. The Save button will save the ProInfo file and the other protection file in the location shown. The SaveAs button will allow you to rename these files, which is recommended for increased security.


Set Password Protection Tool: PC Identifiers

Hardware Configuration Identifies the PC

PC Identifiers are the criteria that the ProtectKit3 uses to uniquely identify the PC running the application. If the PC's hardware configuration does not correspond with the PC Indentifiers set in the protection information, then the ProtectKit3 will determine that the application has been copied to a different machine. The application will then be locked and will not run.

Explanation of the PC Identifiers

In the screenshot of the Set Password Protection tool below, the red box indicates where the PC identifiers are set. In this section of the Set Password Protection tool, there are two radio buttons.

RadioButton 1: CPU, Motherboard Northbridge, VideoCard, and NetworkCard must all be different
This option means that the ProtectKit3 will determine that the PC has changed when all 4 of these hardware identifiers are different from that saved in the password protection information. This option is the least severe option in regard to PC identification. If your customer updated their VideoCard, for example, this option would mean that the protected application would still work on that PC.

RadioButton 2: Choose which of the following must be different:
CPU, Motherboard Northbridge, VideoCard, NetworkCard

This option means that the ProtectKit3 will determine that the PC has changed when any one of the selected hardware identifiers are different. This option is more severe in regard to PC identification. If your customer updated their VideoCard, for example, and you had selected that hardware item to identify the PC, then this option would mean that the protected application would no longer work on that PC.

Checkbox: Add Random Identifier to these PC Identifiers
This option lets you add a series of random numbers to the PC identifiers. These random numbers are saved in the registry and in a file in locations that you specify. The area below indicated in orange is for those settings. For more information see Saving Protection Information in the Registry and Saving Protection Information to File.

This option is used in the follow cases:
a. If there is a possibility that different PCs may have the same hardware configuration, adding a random identifier will give your application the ability to uniquely identify each PC even though the hardware configuration is identical.

b. If you want to set renewable passwords.
The renewable password option is available when setting "number of uses", "number of days", and "number of months" protection. Renewable passwords allow you to lease software for a specified number of days or months or for a specified number of uses. For more information see Renewable Passwords.

How the PC Identifier is constructed

The PC identifiers are used to construct an "identifier string". Consider the following hardware example:

CPU
Idenfication: 10386100640
1 - Manufacturer number
0 - 3DNow command set not supported
3 - Stepping ID
8 - Modal
6 - Command family
1 - Supports MMX

Motherboard Northbridge
Vendor Number: 8086
Product Number: 7124

Video Card
Vendor Number: 8086
Product Number: 7125

Network Card
MAC address: 00E0297CCF83

Random Identifiers
2529609067

In this case the PC identifing string is:
10386100640808671248086712500E0297CCF832529609067

IMPORTANT!!

1. Endusers sometimes change their CPU, Video Card, and Network Card. Be aware that depending on the PC Identifiers that you set, changing these items may cause your application to stop running even though the PC hasn't changed.

2. There are PCs whose video card information cannot be retrieved.

3. Some PCs have multiple CPU and network cards. This may cause inconsistant results when the CPU and network card information is retrieved.


Set Password Protection Tool: Protection Type

The Set Password Protection tool allows you to choose from 5 different password types. The password type determines the kind of password protection that is applied to your .Win32(64) application. Each password type has different features.

Protection Type

Standard Protection: This type of protection locks the application until it it unlocked with a password. After it has been unlocked, the application will run on that PC indefinitely. If the protected application is copied to another PC, it will not work until unlocked on the new PC. There is no "renewal password" option with this type of protection.

Number of Uses Protection: This protection sets the number of times an application can be used. The application can be used for the specified number of uses. Each time the application starts up, that is counted as one use. After the number of allowable uses has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of uses. After the number of allowable uses has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked with a new password, the application will not run indefinitely but will only run again for the number of allowable uses. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

Number of Days Protection: This protection sets the number of days an application can be used. The application can be used for the specified number of days. After the number of allowable days has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of days. After the number of allowable days has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked with a password, the application will not run indefinitely but will only run again for the number of allowable days. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

Number of Months Protection: This protection sets the number of months an application can be used. The application can be used for the specified number of months. After the number of allowable months has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of months. After the number of allowable months has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked with a password, the application will not run indefinitely but will only run again for the number of allowable months. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

Expiration Date Protection: This protection sets the date after which an application will be locked. The application will run until the specifed date is exceeded. After the specified date, the application is locked and will remail locked until unlocked with a password. After being unlocked, the application will run indefinitely. There is no "renewal password" option with this type of protection.


Set Password Protection Tool: Standard Protection

Standard Protection

Standard protection locks the application until it it unlocked with a password. After it has been unlocked, the application will run on that PC indefinitely. If the protected application is copied to another PC, it will not work until unlocked on the new PC. There is no "renewal password" option with this type of protection.

In the above screenshot, we have checked the box "Add Random identifiers to PC Identifiers" (See area indicated in yellow). When this is checked, that information is stored in a location in the registry. You set the location within the registry using the Set Password Protection tool (See area indicated in orange). In this example, the protection information is saved in the registry in this location:

Key: HKEY_CLASSES_ROOT
SubKey: TestApp_Info
Name: Random

If the subkey does not exist, it will be created. You can choose to save protection information under the Key "HKEY_LOCAL_MACHINE\SOFTWARE" using the drop down menu of the combobox.

Unlike our example above, we recommend that you use unrecognizable strings for the subkeys and names where you are saving protection information. This makes it more difficult for someone to discover your protection information. For more information, please see Saving Protection Information To Registry.

Protection information can also be saved to file. This is useful as a backup in case the information in the registry is lost. The file must be saved under the Windows folder or the Windows\System folder in a subfolder and filename that you specify. If the subfolder does not exist, IT WILL NOT BE CREATED. The subfolder must exist prior to saving the protection information to file within this subfolder. For more information, please see Saving Protection Information To File.


Set Password Protection Tool: Number Of Months Protection

Number of Months Protection

This protection sets the number of months an application can be used. The application can be used for the specified number of months. After the number of allowable months has been exceeded, the application is locked and will remain locked until it is unlocked with a password. After being unlocked, the application will run indefinitely. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.

There is a "renewable" password option with this type of protection. This option allows the protected application to run for the specified number of months. After the number of allowable months has been exceeded, the application is locked and will remain locked until it is unlocked with another renewable password. After being unlocked with a new renewable password, the application will only run again for the number of allowable months. At any time, if the protected application is copied to another PC, it will not work until unlocked on the new PC.
For more information, please refer to Using Renewable Passwords.

Screenshot 1: Number of months protection with ordinary password

In the screenshot below, the Protection Type is set to "Number of Months" and the number of allowable months is set to 2. The start date will be counted from "the month of first use". (see areas indicated in red). There are 3 possible choices for setting the start date when the first month is counted.

Setting the start date:
With the number of months protection, you can choose among 3 different possible starting dates. Choose one of the start dates in the drop down menu next to the number of months (see area in red in screenshot below).
From day of first use: Starts on the day that the application is executed for the first time.
From month of first use: Starts at the beginning of the month in which the application is executed for the first time.
From month after first use: Starts at the beginning of the month following the month in which the application is executed for the first time.

For example: Suppose the number of months protection is set for 2 months and the first time the application runs is on 2015/03/16.
From day of first use: Number of months protection begins from 2015/03/16. The application will run until 2015/05/16, after which it will be locked.
From month of first use: Number of months protection begins from 2015/03/01. The application will run until 2015/05/01, after which it will be locked.
From month after first use: Number of months protection begins from 2015/04/01. The application will run until 2015/06/01, after which it will be locked.

When number of months protection is selected, the count of allowable months and the start date are stored in a location in the registry. You set the location within the registry using the Set Password Protection tool. The area is indicated in the screenshot below in orange. In this example, the protection information is saved in the registry in this location:

Key: HKEY_CLASSES_ROOT
SubKey: TestApp_Info
Name: Status

If the subkey does not exist, it will be created. You can also choose to save protection information under the Key "HKEY_LOCAL_MACHINE\SOFTWARE" using the drop down menu of the combobox.

Because the checkbox for adding random information to the PC Identifiers is checked, that information must also be saved in the registry. That protection information is saved in the registry in this location:

Key: HKEY_CLASSES_ROOT
SubKey: TestApp_Info
Name: Random

If the subkey does not exist, it will be created.

Unlike our example below, we recommend that you use unrecognizable strings for the subkeys and names where you are saving protection information. This makes it more difficult for someone to discover your protection information. For more information, please see Saving Protection Information To Registry

Protection information can also be saved to file. This is useful as a backup in case the information in the registry is lost. The file must be saved under the Windows folder or the Windows\System folder in a subfolder and filename that you specify. If the subfolder does not exist, IT WILL NOT BE CREATED. The subfolder must exist prior to saving the protection information to file within this subfolder. For more information, please see Saving Protection Information To File

Screenshot 2: Number of months protection with renewable password

In the screenshot below, the Protection Type is set to "Number of Months" and the number of allowable months is set to 2. The start date will be counted "from the month of first use". (see area indicated in red). In the area indicated in yellow, you can see that random information is added to the PC identifiers and renewable passwords are being used. To use renewable passwords, random information must be added to the PC Identifiers. When random information is added to the PC identifiers, an additional Subkey must be added to the registry information. You can see the "Registry" tab in orange in the screenshot below and the locations in the registry where the information is saved. To see an example of the "File" tab, please refer to the Number of Uses protection.


ProFunc32.dll/ProFunc64.dll

The following commands are used to generate password protected applications. For 32-bit applications, use the ProFunc32.dll. For 64-bit applications, use the ProFunc64.dll

Before using the ProFunc32dll/ProFunc64.dll commands, the program which calls these commands must have a copy of the description of the DLL function declarations (header files found in folder called "Include").

For added security, we recommend that you rename the ProFunc32.dll/ProFunc64.dll to make it less obvious that you are using the ProtectKit. If you rename the ProFunc32.dll/ProFunc64.dll files, you must be sure that your program points to the renamed dll files. When using Visual Basic, in the ProtectKit3.bas file, change the references from "ProFunc32.dll/ProFunc64.dll" to the name of the renamed dll. In VC6, Delphi, and C++ Builder, change the LoadProtectKit3Dll to refer to the newly renamed dll.

Containers and Header Files

Container | Header File Name
C++Builder, VisualC++ | ProtectKit3.h
Delphi | ProtectKit3.pas
VisualBasic | ProtectKit3.bas

DLL Function List (in Alphabetical order)

Function Name | Explanation
PK3DeleteRegistry | Deletes protection information from the registry or from a file
PK3Finish | Closes the ProtectKit and updates the protection information
PK3GetLockword | Retrieves the lockword.
PK3Initialize | Initializes the ProtectKit
PK3Internet | Connects to the specified URL
PK3NextQueryPassword | Queries the next password (for passwords that have an expiration date)
PK3NextQueryPcID | Retrieves the next PcID for passwords that have an expiration date
PK3NextQueryRandom | Retrieves the Random Identifier set in the PcID retrieved by PK3NextQueryPcID
PK3NextSetPassword | Sets the password using the PcID retrieved with the PK3NextQueryPcID function
PK3QueryCpuID | Retrieves the CPU identifier and the CPU name from the PC.
PK3QueryHostBridgeID | Retrieves the northbridge information from the PC's motherboard
PK3QueryNicAdrID | Retrieves the MAC address information from the PC's network card
PK3QueryPassword | Retrieves the password that has been set by the PK3SetPassword function
PK3QueryPcID | Retrieves the PcID
PK3QueryPcIDofPassword | Retrieves a "custom created" (user defined) PcID
PK3QueryProtect | Retrieves the current protection status
PK3QueryProtectInfo | Retrieves the protection information
PK3QueryRandom | Retrieves the random identifier set in the PcID
PK3QueryRemainCount | Retrieves how many "allowable uses" are remaining. (i.e. how many more times the application can be used)
PK3QueryRemainDays | Retrieves how many "allowable days" are remaining. (i.e. how many more days the application can be used)
PK3QueryRemainMonths | Retrieves how many "allowable months" are remaining. (i.e. how many more months the application can be used)
PK3QueryVideoID | Retrieves the video card information
PK3SendMail | Sends email
PK3SetPassword | Sets the password and unlocks the application.
PK3SetPcIDofPassword | Sets a custom (user created) PcID

Structure Definition (User defined type)

(1) C++Builder,VisualC++
typedef struct {
long lProtectWay;
long lCount;
long lDays;
long lMonths;
long lMonthType;
long lExpiration;
BOOL bPasswordExpiration;
long lPasswordType;
long lRegKey;
char szRegSubKeyS[65];
char szRegNameS[65];
char szRegSubKeyR[65];
char szRegNameR[65];
} PROTECTKIT3_INFO;
typedef PROTECTKIT3_INFO * PTR_PROTECTKIT3_INFO;

(2) Delphi
type
PROTECTKIT3_INFO = Record
lProtectWay: Longint;
lCount Longint;
lDays: Longint;
lMonths: Longint;
lMonthType: Longint;
lExpiration: Longint;
bPasswordExpiration: LongBool;
lPasswordType: Longint;
lRegKey: Longint;
szRegSubKeyS: array [0..64] of AnsiChar;
szRegNameS: array [0..64] of AnsiChar;
szRegSubKeyR: array [0..64] of AnsiChar;
szRegNameR: array [0..64] of AnsiChar;
end;

(3) VisualBasic
Type PROTECTKIT3_INFO
lProtectWay As Long
lCount As Long
lDays As Long
lMonths As Long
lMonthType As Long
lExpiration As Long
bPasswordExpiration As Long
lPasswordType As Long
lRegKey As Long
szRegSubKeyS As String * 65
szRegNameS As String * 65
szRegSubKeyR As String * 65
szRegNameR As String * 65
End Type

Explanation of the PROTECTKIT3_INFO Member Variables:

When the PK3QueryProtectInfo command is executed values are set into the PROTECTKIT3_INFO members

lProtectWay refers to the type of protection
0: Standard protection (A password must be generated to use this type of protection)
1: Number of use protection (Application is enabled for a specified number of uses, after which a password is needed)
2: Number of days protection (Application is enabled for a specified number of days, after which a password is needed)
3: Number of months protection (Application is enabled for a specified number of months, after which a password is needed)
4: Dated protection (Application is enabled until a specified date, after which a password is needed)
Note: To require an initial password for the above IProtectWay values of 1, 2, or 3; set the bPasswordExpiration to a value other than 0. See below

lCount refers to the number of times the application can be used. lCount is used when the "Number of use protection" is set (i.e. lProtectWay = 1).
The value for the number of times the application can be used is initialized prior to the application execution.

lDays refers to the number of days the application can be used. lDays is used when the "Number of days protection" is set (i.e. lProtectWay = 2).
The value for the number of days the application can be used is initialized prior to the application execution.

lMonths refers to the number of months the application can be used. lMonths is used when the "Number of months protection" is set (i.e. lProtectWay = 3).
The value for the number of months the application can be used is initialized prior to the application execution.

lMonthType refers to the start day when using "Number of months protection"
0: Starts on the day that the application is executed for the first time.
1: Starts at the beginning of the month in which the application is executed for the first time.
2: Starts at the beginning of the month following the month in which the application is executed for the first time.

For example: The application is first executed on 2010/03/16
0: "Number of months protection" begins from 2010/03/16
1: "Number of months protection" begins from 2010/03/01
2: "Number of months protection" begins from 2010/04/01

lExpiration refers to the expiration date after which the application can no longer be used. lExpiration is used when the "Dated protection" is set (i.e. lProtectWay = 4).
The value for the expiration date is initialized prior to the application execution.

When setting lExpiration use the format yyyymmdd (i.e. an expiration date of December 31, 2001 would be 20011231)

bPasswordExpiration refers to whether or not the password will expire. Use this in conjunction with lProtectWay
0: Password does not expire.
Nonzero: Password expires.

lPasswordType refers to the configuration of the password
0: Numerical
1: Alpha-numeric (letters + numerals)
2: Alpha-numeric (Capital letters + numerals)

lRegKey refers to the registry root key where protection information is stored
0: HKEY_CLASSES_ROOT
1: HKEY_LOCAL_MACHINE\SOFTWARE

szRegSubKeyS refers to the registry subroot key where the protection status is stored
szRegNameS refers to the registry item name where the protection status is stored
szRegSubKeyR refers to the registry subroot key where the protection information is stored
szRegNameR refers to the registry item name where the protection information is stored


PK3DeleteRegistry

This function deletes protection information from the registry or from a file.

[C++Builder/Visual C++] BOOL PK3DeleteRegistry(void);
[Delphi] function PK3DeleteRegistry: LongBool;
[Visual Basic] Function PK3DeleteRegistry() As Long

Parameters

None

Return Value

Returns True (non-zero) if successful, otherwise returns False (0).

Explanation

The PK3DeleteRegistry function deletes protection information from the registry and/or from a file.

NOTE: Executing the PK3Finish function will save the protection information into the registry or into a file. If you are using the PK3DeleteRegistry function to delete the protection information, do not execute the PK3Finish function after executing the PK3DeleteRegistry function.


PK3Finish

This function closes the ProtectKit and updates the protection information.

[C++Builder/Visual C++] BOOL PK3Finish(void);
[Delphi] function PK3Finish: LongBool;
[Visual Basic] Function PK3Finish() As Long

Parameters

None

Return Value

Returns True (non-zero) if successful, otherwise returns False (0).

Explanation

The PK3Finish function closes the ProtectKit and updates the protection information.

For example: You have set "Run Count" protection on an application allowing that application to run only a specific number of times. The application is started and when it is closed, the PK3Finish function executes and the run count is reduced by 1. If the PK3Finish command does not execute when the application is closed, the protection information is not updated and the applications run count does not change.

In this way, if the PK3Finish function does not execute, the protect information is not updated and that is why you must be sure to execute the PK3Finish command when the application closes.

Prior to executing the PK3Finish command, the PK3Initialize command must have been executed. If it has not, the PK3Finish command is ineffective.


PK3GetLockword

This function retrieves the lockword.

[C++Builder/Visual C++] BOOL PK3GetLockword(LPSTR lpszLockword);
[Delphi] function PK3GetLockword(lpszLockword: PAnsiChar): Longint;
[Visual Basic] Function PK3GetLockword(ByVal lpszLockword As String) As Long

Parameters

Name | Explanation
lpszLockword | The retrieved lockword (from 8 to 64 digits) In C++Builder, Visual C++, and Delphi. this is a string terminating with Null. In Visual Basic, this is a string of specified size. (The lockword specified in the "Set Protection" tool.)

Return Value

Returns the number of digits of the retrieved lpszLockword if successful, otherwise returns False (0).

Explanation

The PK3GetLockword function retrieves the lockword that was set by the "Set Protection" tool. The function is disabled if the PK3Initialize function has not been executed.


PK3Initialize

This function initializes the ProtectKit3.

[C++Builder/Visual C++] long PK3Initialize(LPCSTR lpszAppName, LPCSTR lpszProtectResDll);
[Delphi] function PK3Initialize(lpszAppName, lpszProtectResDll: PAnsiChar): Longint;
[Visual Basic] Function PK3Initialize(ByVal lpszAppName As String, ByVal lpszProtectResDll As String) As Long

Parameters

Name | Explanation
lpszAppName | The name of the application that is to be protected.
lpszProtectResDll | The name of the file where the protection information is stored.

Return Value

Value | Explanation
0 | The ProtectKit is running properly.
1 | The ProtectKit is not running. (DdScm.exe has not been executed)
2 | Unable to load the protection file.
3 | The application's lockword is not set or is not correct. (Please use the ""Set Protection" tool to set the lockword.
4 | The execution environment is not on the local hard disk.
5 | The protection file, where the protection information is stored, is incorrect.

Explanation

The PK3Initialize function initializes the ProtectKit. Once the ProtectKit has been initialized and is running properly, the protection information can be retrieved.


PK3Internet

This function connects to the specified URL.

[C++Builder/Visual C++] BOOL PK3Internet(HWND hWnd, LPCSTR lpszURL);
[Delphi] function PK3Internet(hWnd: HWND; lpszURL: PAnsiChar): LongBool;
[Visual Basic] Function PK3Internet(ByVal hWnd As Long, ByVal lpszURL As String) As Long

Parameters

Name | Explanation
hWnd | The window handle
lpszURL | The URL

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3Internet function connects to the specified URL.


PK3NextQueryPassword

For passwords that have an expiration date, this function queries the next password.

[C++Builder/Visual C++] BOOL PK3NextQueryPassword(LPSTR lpszPassword, LPLONG lpPasswordLen);
[Delphi] function PK3NextQueryPassword(lpszPassword: PAnsiChar; var lpPasswordLen: Longint): LongBool;
[Visual Basic] Function PK3NextQueryPassword(ByVal lpszPassword As String, lpPasswordLen As Long) As Long

Parameters

Name | Explanation
lpszPassword | The password set by PK3NextSetPassword In C++Builder, Visual C++, and Delphi. this is a string terminating with Null. In Visual Basic, this is a string of specified size. (The lockword specified in the "Set Protection" tool.)
lpPasswordLen | The number of digits in the retrieved password (lpszPassword)

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

For passwords that have an expiration date, the PK3NextQueryPassword function queries the next password.


PK3NextQueryPcID

This function retrieves the next PcID for passwords that have an expiration date.

[C++Builder/Visual C++] BOOL PK3NextQueryPcID(LPSTR lpszPcID, LPLONG lpPcIDLen);
[Delphi] function PK3NextQueryPcID(lpszPcID: PAnsiChar; var lpPcIDLen: Longint): LongBool;
[Visual Basic] Function PK3NextQueryPcID(ByVal lpszPcID As String, lpPcIDLen As Long) As Long

Parameters

Name | Explanation
lpszPcID | The retreived PcID (maximum length is 64 digits) In C++Builder, Visual C++, and Delphi. this is a string terminating with Null. In Visual Basic, this is a string of specified size.
lpPcIDLen | The number of digits in the retrieved PcID (lpszPcID)

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

For passwords that have an expiration date, the PK3NextQueryPcID function retrieves the next PcID according to the conditions specified in the Pr3SetProtect.exe. Note that this function is disabled if the PK3Initialize function has not been executed.

Example:

Run the Pr3SetProtect.exe. Under "PC Identifiers", select the checkbox "CPU, Motherboard Northbridge, VideoCard, and NetworkCard must all be different". Check the checkbox "Add Random Identifier to these PC identifiers". In this case the PcID will be in the following order: "CPU identifier" + "Motherboard Northbridge identifier" + "VideoCard identifier" + "NetworkCard MAC address" + "a Random Identifier"

For more information, please refer to PK3QueryCpuID, PK3QueryHostBridgeID, PK3QueryVideoID, and PK3QueryNicAdrID.

Note: The PK3QueryPcID function is able to retrieve the PcID after the password has expired, whereas thePK3NextQueryPcID function is able to retreive the PcID before the password has expired. For this reason, thePK3NextQueryPcID function and can be used to get the PcID in order to generate passwords prior to the expiration.

The PK3NextQueryPcID function is disabled when there is no expiration for the password.


PK3NextQueryRandom

This function gets the Random Identifier set in the PcID retrieved by PK3NextQueryPcID. This function works for passwords that have an expiration date.

[C++Builder/Visual C++] BOOL PK3NextQueryRandom(LPSTR lpszRandom, LPLONG lpRandomLen);
[Delphi] function PK3NextQueryRandom(lpszRandom: PAnsiChar; var lpRandomLen: Longint): LongBool;
[Visual Basic] Function PK3NextQueryRandom(ByVal lpszRandom As String, lpRandomLen As Long) As Long

Parameters

Name | Explanation
lpszRandom | The retreived Random Identifier (length is 10 digits) In C++Builder, Visual C++, and Delphi. this is a string of 10 digits followed by a terminating Null. In Visual Basic, this is a string of 10 digits.
lpRandomLen | The number of digits in the retrieved Random Identifier

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3NextQueryRandom function gets the Random Identifier set in the PcID retrieved by PK3NextQueryPcID.

The PK3NextQueryRandom function is disabled when the password has no expiration or if the PK3Initialize function has not been executed.


PK3NextSetPassword

This function sets the password using the PcID retrieved with the PK3NextQueryPcID function. The function works for passwords that have an expiration date.

[C++Builder/Visual C++] BOOL PK3NextSetPassword(LPSTR lpszPassword);
[Delphi] function PK3NextSetPassword(lpszPassword: PAnsiChar): LongBool;
[Visual Basic] Function PK3NextSetPassword(ByVal lpszPassword As String) As Long

Parameters

Name | Explanation
lpszPassword | The password to be set

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3NextSetPassword function sets the password using the PcID retrieved with the PK3NextQueryPcID function.

The PK3NextSetPassword function is disabled when the password has no expiration.


PK3QueryCpuID

This function retrieves the CPU identifier and the CPU name from the PC.

[C++Builder/Visual C++] BOOL PK3QueryCpuID(LPSTR lpszCpuID, LPLONG lpCpuIDLen, LPSTR lpszCpuName, LPLONG lpCpuNameLen);
[Delphi] function PK3QueryCpuID(lpszCpuID: PAnsiChar; var lpCpuIDLen: Longint; lpszCpuName: PAnsiChar; var lpCpuNameLen: Longint): LongBool;
[Visual Basic] Function PK3QueryCpuID(ByVal lpszCpuID As String, lpCpuIDLen As Long, ByVal lpszCpuName As String, lpCpuNameLen As Long) As Long

Parameters

Name | Explanation
lpszCpuID | The retrieved CPU identifier In C++Builder, Visual C++, and Delphi. this is a string terminating with Null. In Visual Basic, this is a string of specified size.
lpCpuIDLen | The length (in digits) of the retrieved CPU identifier.
lpszCpuName | The name of the retrieved CPU.
lpCpuNameLen | The length (in digits) of the retrieved CPU name.

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3QueryCpuID function retrieves the CPU identifier and CPU name from the PC.

The PK3QueryCpuID function is disabled if the PK3Initialize function has not been executed.

IMPORTANT: If the PK3QueryCpuID function is used on a PC with multiple CPUs, the CPU identifier retrieved may not be constant. Because of this, after a password has been issued to unlock an application and that application has been uninstalled and reinstalled, there are cases where the previously generated password will no longer unlock the application. (When CPU is included as one condition for identifying a PC)

The CPU identifier will be in the following order: "Manufacturer number" + "3DNow Command Set Support" + "Stepping ID" + "Model" + "Command Family" + "MM Support". The various items will be seperated by hyphens "-". The number of digits in the CPU identifier will be different depending on the CPU.


PK3QueryHostBridgeID

This function retrieves the northbridge information from the PC's motherboard.

[C++Builder/Visual C++] BOOL PK3QueryHostBridgeID(LPLONG lpVendorID, LPSTR lpszVendorName, LPLONG lpVendorNameLen, LPLONG lpDeviceID);
[Delphi] function PK3QueryHostBridgeID(var lpVendorID: Longint; lpszVendorName: PAnsiChar; var lpVendorNameLen: Longint; var lpDeviceID: Longint): LongBool;
[Visual Basic] Function PK3QueryHostBridgeID(lpVendorID As Long, ByVal lpszVendorName As String, lpVendorNameLen As Long, lpDeviceID As Long) As Long

Parameters

Name | Explanation
lpVendorID | The retrieved vendor number
lpszVendorName | The retrieved vendor name In C++Builder, Visual C++, and Delphi. this is a string terminating with Null. In Visual Basic, this is a string of specified size.
lpVendorNameLen | The length (in digits) of the retrieved vendor name.
lpDeviceID | The retrieved product number.

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3QueryHostBridgeID function retrieves the northbridge vendor number, name, and product number from the PC's motherboard.

The PK3QueryHostBridgeID function is disabled if the PK3Initialize function has not been executed.

The Motherboard Northbridge identifier (contained in the PcID as retrieved by the PK3QueryPcID function) will be a number made of the "vendor number (4 digits)" + "product number (4 digits)" . This number is then converted to a string. In most cases, the northbridge cannot be detached from the motherboard which is not hte case with a CPU's video card or network card.


PK3QueryNicAdrID

This function retrieves the MAC address information from the PC's network card.

[C++Builder/Visual C++] BOOL PK3QueryNicAdrID(LPLONG lpVendorID, LPSTR lpszVendorName, LPLONG lpVendorNameLen, LPLONG lpDeviceID, LPSTR lpszMacAddress, LPLONG lpMacAddressLen);
[Delphi] function PK3QueryNicAdrID(var lpVendorID: Longint; lpszVendorName: PAnsiChar; var lpVendorNameLen: Longint; var lpDeviceID: Longint; lpszMacAddress: PAnsiChar; var lpMacAddressLen: Longint): LongBool;
[Visual Basic] Function PK3QueryNicAdrID(lpVendorID As Long, ByVal lpszVendorName As String, lpVendorNameLen As Long, lpDeviceID As Long, ByVal lpszMacAddress As String, lpMacAddressLen: Long) As Long

Parameters

Name | Explanation
lpVendorID | The retrieved vendor number
lpszVendorName | The retrieved vendor name In C++Builder, Visual C++, and Delphi. this is a string terminating with Null. In Visual Basic, this is a string of specified size.
lpVendorNameLen | The length (in digits) of the retrieved vendor name.
lpDeviceID | The retrieved product number.
lpszMacAddress | The retrieved Mac address
lpMacAddressLen | The length (in digits) of the retrieved Mac address.

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3QueryNicAdrID function retrieves the MAC address information from the PC's network card.

The PK3QueryNicAdrID function is disabled if the PK3Initialize function has not been executed.

IMPORTANT: If the PK3QueryNicAdrID function is used on a PC with multiple network cards, the Mac address retrieved may not be constant. Because of this, after a password has been issued to unlock an application and that application has been uninstalled and reinstalled, there are cases where the previously generated password will no longer unlock the application. (When the network card is included as one condition for identifying a PC).


PK3QueryPassword

This function retrieves the password that has been set by the PK3SetPassword function.

[C++Builder/Visual C++] BOOL PK3QueryPassword(LPSTR lpszPassword, LPLONG lpPasswordLen);
[Delphi] function PK3QueryPassword(lpszPassword: PAnsiChar; var lpPasswordLen: Longint): LongBool;
[Visual Basic] Function PK3QueryPassword(ByVal lpszPassword As String, lpPasswordLen As Long) As Long

Parameters

Name | Explanation
lpszPassword | The password set by PK3SetPassword In C++Builder, Visual C++, and Delphi. this is a string terminating with Null. In Visual Basic, this is a string of specified size.
lpPasswordLen | The number of digits in the retrieved password (lpszPassword)

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3QueryPassword function retrieves the password that has been set by the PK3SetPassword function. When protection is unlocked, this function can be used to query the password that was set. (If protection is not unlocked, the PK3QueryPassword function will return True but 0 will be set in the lpPasswordLen parameter.

The PK3QueryPassword function is disabled when the password has no expiration or if the PK3Initialize function has not been executed.

Note: The number of digits in the password will be set to match the number of digits in the lockword or the PcID, whichever is largest.


PK3QueryPcID

This function retrieves the PcID.

[C++Builder/Visual C++] BOOL PK3QueryPcID(LPSTR lpszPcID, LPLONG lpPcIDLen);
[Delphi] function PK3QueryPcID(lpszPcID: PAnsiChar; var lpPcIDLen: Longint): LongBool;
[Visual Basic] Function PK3QueryPcID(ByVal lpszPcID As String, lpPcIDLen As Long) As Long

Parameters

Name | Explanation
lpszPcID | The retrieved PcID (Maximum length is 64 digits) In C++Builder, Visual C++, and Delphi. this is a string terminating with Null. In Visual Basic, this is a string of specified size.
lpPcIDLen | The number of digits in the retrieved PcID

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3QueryPcID function retrieves the PcID that has been generated using the PK3SetProtect.exe.

The PK3QueryPcID function is disabled when the password has no expiration or if the PK3Initialize function has not been executed.

Example:

Run the Pr3SetProtect.exe. Under "PC Identifiers", select the checkbox "CPU, Motherboard Northbridge, VideoCard, and NetworkCard must all be different". Check the checkbox "Add Random Identifier to these PC identifiers". In this case the PcID will be in the following order: "CPU identifier" + "Motherboard Northbridge identifier" + "VideoCard identifier" + "NetworkCard MAC address" + "a Random Identifier"

For more information, please refer to PK3QueryCpuID, PK3QueryHostBridgeID, PK3QueryVideoID, and PK3QueryNicAdrID.


PK3QueryPcIDofPassword

This function retrieves a "custom created" (user defined) PcID.

[C++Builder/Visual C++] BOOL PK3QueryPcIDofPassword(LPSTR lpszPcID, LPLONG lpPcIDLen);
[Delphi] function PK3QueryPcIDofPassword(lpszPcID: PAnsiChar; var lpPcIDLen: Longint): LongBool;
[Visual Basic] Function PK3QueryPcIDofPassword(ByVal lpszPcID As String, lpPcIDLen As Long) As Long

Parameters

Name | Explanation
lpszPcID | The retrieved PcID (Maximum length is 64 digits) In C++Builder, Visual C++, and Delphi. this is a string terminating with Null. In Visual Basic, this is a string of specified size.
lpPcIDLen | The number of digits in the retrieved PcID

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3QueryPcIDofPassword function retrieves a "custom created" PcID.

The PK3QueryPcIDofPassword function is disabled when the password has no expiration or if the PK3Initialize function has not been executed.


PK3QueryProtect

This function retrieves the current protection status.

[C++Builder/Visual C++] long PK3QueryProtect(void);
[Delphi] function PK3QueryProtect: Longint;
[Visual Basic] Function PK3QueryProtect() As Long

Parameters

None

Return Values

Value | Explanation
0 | Not Protected
1 | Protected (the application does not run)
2 | Has exceeded allowable number of uses. (Valid if "number of uses" protection is used.)
3 | Has exceeded allowable number of days. (Valid if "number of days" protection is used.)
4 | Has exceeded allowable number of months. (Valid if "number of months" protection is used.)
5 | Has exceeded allowable date. (Valid if "date" protection is used.)
6 | The PC's datetime has been altered. (Valid for "number of days", "number of months", and "date" type protection.)
7 | Runtime environment (PC) is different.
8 | The protection file is not correct.
9 | The lockword is not correct.
10 | The password is not correct.
11 | Other
12 | The protection file is being used improperly

Explanation

The PK3QueryProtect function retrieves the current protection status..

The PK3QueryProtect function is disabled if the PK3Initialize function has not been executed.

When the return value is 0, you can get more detailed information depending on the type of protection used ("number of uses", "number of days", "number of months", and "date" type protection)

by referring to the following properties: PK3QueryRemainCount, PK3QueryRemainDays, and PK3QueryRemainMonths)

The return value of 12 means that allowable uses, days, months, or date has been exceeded and then correct protection file was overwritten by an improper protection file.


PK3QueryProtectInfo

This function retrieves the protection information.

[C++Builder/Visual C++] BOOL PK3QueryProtectInfo(PTR_PROTECTKIT3_INFO pi);
[Delphi] function PK3QueryProtectInfo(var pi: PROTECTKIT3_INFO): LongBool;
[Visual Basic] Function PK3QueryProtectInfo(pi As PROTECTKIT3_INFO) As Long

Parameters

Name | Explanation
pi | The retieved protection information structure variable (User defined type PROTECTKIT3_INFO)

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3QueryProtectInfo function retrieves the protection information.

The PK3QueryProtectInfo function is disabled when the password has no expiration or if the PK3Initialize function has not been executed.

For detailed information about the PROTECTKIT3\INFO, please refer to the "ProFunc32.dll/ProFunc64.dll's PROTECTKIT3_INFO member variables.


PK3QueryRandom

This function retrieves the random identifier set in the PcID.

[C++Builder/Visual C++] BOOL PK3QueryRandom(LPSTR lpszRandom, LPLONG lpRandomLen);
[Delphi] function PK3QueryRandom(lpszRandom: PAnsiChar; var lpRandomLen: Longint): LongBool;
[Visual Basic] Function PK3QueryRandom(ByVal lpszRandom As String, lpRandomLen As Long) As Long

Parameters

Name | Explanation
lpszRandom | The retrieved Random Identifier (10 digits) In C++Builder, Visual C++, and Delphi. this is a string of 10 digits followed by a terminating Null. In Visual Basic, this is a string of 10 digits.
lpRandomLen | The number of digits in the retrieved Random Identifier

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3QueryRandom function retrieves the random identifier set in the PcID. This function can be used with the "Add Random Identifier to PC identifiers" checkbox has been checked in the Pr3SetProtect.exe.

The PK3QueryRandom function is disabled if the PK3Initialize function has not been executed.


PK3QueryRemainCount

This function retrieves how many "allowable uses" are remaining. (i.e. how many more times the application can be used)

[C++Builder/Visual C++] long PK3QueryRemainCount(void);
[Delphi] function PK3QueryRemainCount: Longint;
[Visual Basic] Function PK3QueryRemainCount() As Long

Parameters

None

Return Value

Value | Explanation
The number of allowable uses remaining | This return value is possible when the PK3QueryProtect function returns 0 (which means the application is still allowed to run) and the remaining allowable uses is non-zero.
-1 | This return value is possible when the PK3QueryProtect function returns non-zero (which means the application is no longer allowed to run); or when an unrestricted password has been generated and the application has been unlocked without any other restrictions.

Explanation

The PK3QueryRemainCount function retrieves how many "allowable uses" are remaining. (i.e. how many more times the application can be used). This function will only return the "remaining allowable uses" when that type of protection has been applied. If other types of protection are used or if the application software has been unlocked without other restrictions, the PK3QueryRemainCount function will return -1.

The PK3QueryRemainCount function is disabled if the PK3Initialize function has not been executed.


PK3QueryRemainDays

This function retrieves how many "allowable days" are remaining. (i.e. how many more days the application can be used)

[C++Builder/Visual C++] long PK3QueryRemainDays(void);
[Delphi] function PK3QueryRemainDays: Longint;
[Visual Basic] Function PK3QueryRemainDays() As Long

Parameters

None

Return Value

Value | Explanation
The number of allowable days remaining | This return value is possible when the PK3QueryProtect function returns 0 (which means the application is still allowed to run) and the remaining allowable days is non-zero.
A negative value other than -1 (i.e. -3) | This return value is possible when the PK3QueryProtect function returns 3, 4, or 5 (which means the remaining allowable days, remaining allowable months, or protection date has been exceeded). In this case the negative number is the number of days exceeded. (i.e. A return value of -3 means that 3 days have elasped since the remaining allowable days, remaining allowable months, or the protection date was exceeded.)
-1 | This return value is possible when the PK3QueryProtect function returns 1 (which means the application is currently locked); or when a restricted password has been set and the remaining allowable days, remaining allowable months, or protection date have been exceeded. This return value is also possible when the PK3QueryProtect function returns any values other than 0, 1, 3, 4 or 5.

Explanation

The PK3QueryRemainDays function retrieves how many "allowable days" are remaining. (i.e. how many more days the application can be used). This function will only return the "remaining allowable days" when the type of protection that has been applied is "number of days", "number of months", or "date". If other types of protection are used or if the application software has been unlocked without other restrictions, the PK3QueryRemainDays function will return -1.

The PK3QueryRemainDays function is disabled if the PK3Initialize function has not been executed.


PK3QueryRemainMonths

This function retrieves how many "allowable months" are remaining. (i.e. how many more months the application can be used)

[C++Builder/Visual C++] long PK3QueryRemainMonths(void);
[Delphi] function PK3QueryRemainMonths: Longint;
[Visual Basic] Function PK3QueryRemainMonths() As Long

Parameters

None

Return Value

Value | Explanation
The number of allowable months remaining | This return value is possible when the PK3QueryProtect function returns 0 (which means the application is still allowed to run) and the remaining allowable months is non-zero.
a negative value other than -1 (i.e. -3) | This return value is possible when the PK3QueryProtect function returns 4 (which means the remaining allowable months have been exceeded). In this case the negative number is the number of months exceeded. (i.e. A return value of -3 means that 3 months have elasped since the remaining allowable months was exceeded.)
-1 | This return value is possible when the PK3QueryProtect function returns 1 (which means the application is currently protected); or when a restricted password has been set and the remaining allowable months has been exceeded. This return value is also possible when the PK3QueryProtect function returns any values other than 0, 1, or 4.

Explanation

The PK3QueryRemainMonths function retrieves how many "allowable months" are remaining. (i.e. how many more months the application can be used). This function will only return the "remaining allowable months" when the type of protection that has been applied is "number of months". If other types of protection are used or if the application software has been unlocked without other restrictions, the PK3QueryRemainMonths function will return -1.

The PK3QueryRemainMonths function is disabled if the PK3Initialize function has not been executed.


PK3QueryVideoID

This function retrieves the video card information.

[C++Builder/Visual C++] BOOL PK3QueryVideoID(LPLONG lpVendorID, LPSTR lpszVendorName, LPLONG lpVendorNameLen, LPLONG lpDeviceID);
[Delphi] function PK3QueryVideoID(var lpVendorID: Longint; lpszVendorName: PAnsiChar; var lpVendorNameLen, lpDeviceID: Longint): LongBool;
[Visual Basic] Function PK3QueryVideoID(lpVendorID As Long, ByVal lpszVendorName As String, lpVendorNameLen As Long, lpDeviceID As Long) As Long

Parameters

Name | Explanation
lpVendorID | The retrieved vendor number
lpszVendorName | The retrieved vendor name In C++Builder, Visual C++, and Delphi. this is a string terminating with Null. In Visual Basic, this is a string of specified size.
lpVendorNameLen | The length (in digits) of the retrieved vendor name.
lpDeviceID | The retrieved product number.

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3QueryVideoID function retrieves the video card information from the PC.

The PK3QueryVideoID function is disabled if the PK3Initialize function has not been executed.

The video card information is part of the PcID as retrieved by the PK3QueryPcID function and takes the form: VendorID (4 digits) + DeviceID (4 digits). This 8 digit number is converted to a string.


PK3SendMail

This function sends email.

[C++Builder/Visual C++] long PK3SendMail(LPCSTR lpszMailSvrAddr, LPCSTR lpszFromAddr, LPCSTR lpszFromHdr, LPCSTR lpszToAddr, LPCSTR lpszToHdr, LPCSTR lpszSubject, LPCSTR lpszMessage);
[Delphi] function PK3SendMail(lpszMailSvrAddr, lpszFromAddr, lpszFromHdr, lpszToAddr, lpszToHdr, lpszSubject, lpszMessage: PAnsiChar): Longint;
[Visual Basic] Function PK3SendMail(ByVal lpszMailSvrAddr As String, ByVal lpszFromAddr As String, ByVal lpszFromHdr As String, ByVal lpszToAddr As String, ByVal lpszToHdr As String, ByVal lpszSubject As String, ByVal lpszMessage As String) As Long

Parameters

Name | Explanation
lpszMailSvrAddr | The address of the mail server (SMTP) sending the email
lpszFromAddr | The email address of the sender
lpszFromHdr | The sender's name
lpszToAddr | The email address of the receiver
lpszToHdr | The recipent's name
lpszSubject | The subject of the email
lpszMessage | The email message (content).

Return Value

Return Value | Explanation
0 | Message Sent
1 | Must have Winsock version 1.1 or above
2 | Unable to find the SMTP mail server
3 | Unable to open mail server socket
4 | Failed to connect to mail server socket
5 | Incorrect or missing parameters
6 | Memory error
7 | Transmission error

Explanation

The PK3SendMail function sends email.

In order to start a new line, you must use a newline character (i.e. LF, CR, CRLF, etc.)

If using a dial up connection, please be sure you are connected before executing this function.


PK3SetPassword

This function sets the password and unlocks the application.

[C++Builder/Visual C++] BOOL PK3SetPassword(LPSTR lpszPassword);
[Delphi] function PK3SetPassword(lpszPassword: PAnsiChar): LongBool
[Visual Basic] Function PK3SetPassword(ByVal lpszPassword As String) As Long

Parameters

Name | Explanation
lpszPassword | The password to be set

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3SetPassword function sets the password for the PcID retrieved by the PK3QueryPcID function and unlocks the application.


PK3SetPcIDofPassword

This function sets a custom (user created) PcID

[C++Builder/Visual C++] BOOL PK3SetPcIDofPassword(LPCSTR lpszPcID);
[Delphi] function PK3SetPcIDofPassword(lpszPcID: PAnsiChar): LongBool;
[Visual Basic] Function PK3SetPcIDofPassword(ByVal lpszPcID As String) As Long

Parameters

Name | Explanation
lpszPcID | The PcID to be set (from 8 to 64 digits)

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3SetPcIDofPassword function sets a custom (user created) PcID and can be used if you do not want to use the PcID queried by PK3QueryPcID. Note this function is disabled if a valid password has already been set.

The PK3SetPcIDofPassword function is disabled if the PK3Initialize function has not been executed.


ProtectKit3.5 Win32(64) Sample Programs: It is copy protection for your software. It prevents software theft. It prevents unauthorized copies of your software from running. It stops people from stealing your software. It protects applications from illegal copying and unauthorized use.

ProtectKit3

Explanation of Win32(64) Samples

Explanation of the sample programs for Win32(64) environments:

The ProtectKit3.5 includes several sample programs for Win32(64) environments. Using these sample programs is a good way to learn how to protect your own applications.

The ProtectKit3.5 sample projects are included in the folder: "\Password Protection\Set Password Protection\For Win32(64)\Sample Programs (Win32-64)\" under the directory where the ProtectKit3.5 was installed. Below is a list of these sample programs and a brief explanation for each.

IMPORTANT: In all of these sample projects and programs, the Lockword used is "AbcdefgH". If you are using the ProtectKit3.5 trial version, you MUST use the Lockword "AbcdefgH". It cannot be changed. If you are using the ProtectKit3.5 retail version, you can choose a different lockword between 8 and 64 alpha-numeric characters.

32 bit application samples:

CBuilder6:

This is a 32 bit sample program built in CBuilder6. To run the sample, copy the ProInfo32.dll and the ProFunc32.dll in the same directory as the Project1.exe. If the Project1.exe is not already built, build it. Then use the Set Password Protection Tool for Win32-64 (Pr3SetProtect.exe) to set protection into the Project1.exe. You can now run the sample. To unlock the application, use the Password Generator (Pr3PassGen.exe) to generate and unlock password.

Delphi6:

This is a 32 bit sample program built in Delphi6. To run the sample, copy the ProInfo32.dll and the ProFunc32.dll in the same directory as the Project1.exe. If the Project1.exe is not already built, build it. Then use the Set Password Protection Tool for Win32-64 (Pr3SetProtect.exe) to set protection into the Project1.exe. To unlock the application, use the Password Generator (Pr3PassGen.exe) to generate and unlock password.

Protect_2EXE:

This is a 32 bit sample program containing two executable files, one built in VB6 and the other built in VC++6. In this sample, the two executable programs, Project1.exe and Project2.exe, have the same protection and share the same protection file. When one executable program is unlocked, the other executable program is also unlocked.

To relate two executable programs to the same protection file, in the initialization code of each program do the following:

Project1.exe
PK3Initialize("Project1.exe", "ProInfo32.DLL");

Project2.exe
PK3Initialize("Project2.exe", "ProInfo32.DLL");

If the protection type is set to "number of uses", then the total number of uses will be the total uses of Project1 + Project2.

After the 2 executable program EXEs were built, the Set Password Protection tool was used and Standard Protection was set. Please use the Password Generator (Pr3PassGen.exe) to unlock the programs. To change the protection type, run the Set Password Protection tool and use the ProInfo32.dll, Project1.exe, and Project2.exe that are in the same folder.

Protect_DLL:

This sample program illustrates how to add protection to a DLL file that is being called by an EXE.

In the Protect_DLL folder are the following files:

Protect_DLL
| Project1.exe: The EXE that calls the protected Sample.dll
| Sample.dll: The DLL file that is protected
| ProFunc32.dll: The ProtectKit3 function file. If this file is not in the same folder as the Project.exe and Sample.dll, please copy it to this folder.
| ProInfo32.dll: The protection information file. If this file is not in the same folder as the Project.exe and Sample.dll, please copy it to this folder.
|
|-- Vb6_EXE
| The VB6 project that creates the Project1.exe. (The EXE file that calls the protected DLL).
|
|-- Vb6_DLL
| The VC++6 project that created the Sample.dll. (This Sample.dll is protected using the Set Password Protection Tool)

Protection
Please use the Set Password Protection Tool (Pr3SetProtect.exe) to set protection inot the Sample.dll

Execute
When Project1.exe is executed the protection functions are called in the following manner:
Project1.exe <---> Sample.dll <---> ProFunc32.dll <---> ProInfo32.dll

Vb6:

This is a 32 bit sample program built in Visual Basic 6. To run the sample, copy the ProInfo32.dll and the ProFunc32.dll in the same directory as the Project2.exe. If the Project2.exe is not already built, build it. Then use the Set Password Protection Tool for Win32-64 (Pr3SetProtect.exe) to set protection into the Project2.exe. To unlock the application, use the Password Generator (Pr3PassGen.exe) to generate and unlock password.

Vb6_2:

This is a 32 bit sample program built in Visual Basic 6. It is similiar to the above sample called "Vb6" except this sample shows how to display a dialog that asks for an unlock password. To run the sample, copy the ProInfo32.dll and the ProFunc32.dll in the same directory as the Sample1.exe. If the Sample1.exe is not already built, build it. Then use the Set Password Protection Tool for Win32-64 (Pr3SetProtect.exe) to set protection into the Sample1.exe. To unlock the application, use the Password Generator (Pr3PassGen.exe) to generate and unlock password.

Vc6:

This is a 32 bit sample program built in Visual C++ 6. To run the sample, copy the ProInfo32.dll and the ProFunc32.dll in the same directory as the Project1.exe found in the Release folder. If the Project1.exe is not already built, build it. Then use the Set Password Protection Tool for Win32-64 (Pr3SetProtect.exe) to set protection into the Project1.exe. To unlock the application, use the Password Generator (Pr3PassGen.exe) to generate and unlock password.

64 bit application samples:

VisualC++2005:

This is a 64 bit sample program built in VisualC++ 2005. To run the sample, copy the ProInfo64.dll and the ProFunc64.dll in the same directory as the Project1.exe found in the "x64\Release" folder. If the Project1.exe is not already built, build it. Then use the Set Password Protection Tool for Win32-64 (Pr3SetProtect.exe) to set protection into the Project1.exe. To unlock the application, use the Password Generator (Pr3PassGen.exe) to generate and unlock password.

How to run the samples:

To run an EXE built from these projects, copy the ProtectKit's ProFunc32(64).dll and the ProInfo32(64).dll into the same folder as the EXE.

After you have copied these files, run the Set Password Protection tool (Pr3SetProtect.exe) and set the appropriate protection information into the ProInfo32(64).dll and EXE. The Set Password Protection tool sets the protection information both the protection information file and into the executable program. It is this one to one correspondence between the ProInfo file and the protection information embedded into your application that enables protection. If you want to change the Lockword, you will need change the Lockword check code in your application and rebuild it. Then use the Set Password Protection Tool again to set the Lockword into the protection information.

For more information about that, please see step #1 and #2 in Password Protection: Example For Win32(64) Apps.

Explanation of the Sample Applications:

The following labels and buttons appear in the sample program.

A. Protection Type:
Shows the type of protection that was set using the "Set Password Protection" tool.

B. Protection Status:
Shows the current protection status; i.e. whether the application is locked, unlocked, etc.

C. Remaining Uses:
Shows the number of times that the application can be used. This is applicable when "Number of Uses" type protection is used.

D. Remaining Days:
Shows the number of days that the application can be used. This is applicable when "Number of Days" type protection is used.

E. Remaining Months:
Shows the number of months that the application can be used. This is applicable when "Number of Months" type protection is used.

F. Expiration Date:
Shows the date after which the application can not be used. This is applicable when "Expiration Date" type protection is used.

G. VideoCard:
Shows the video card information of the PC running the EXE.

H. Motherboard:
Shows the motherboard information of the PC running the EXE.

H. LAN card:
Shows the LAN card information of the PC running the EXE.

J. Random Numbers:
Shows any random numbers that have been set in the protection information This will not show anything if random numbers are not being used.

K. CPU:
Shows the CPU information of the PC running the EXE.

L. GET PcID (Default):
This retrieves the default PcID of the PC running the EXE. This is the default PcID information.

M. SET PcID (User Specified):
This sets the user specified PcID for the PC running the EXE.

N. GET PcID (User Specified):
This retrieves the current valid PcID, whether a default PcID or a user specfied PcID.

O. Set Password:
This sets the password needed to unlock the application.

P. Remove Registry Information:
This deletes the protection information that has been set in the registry.

Improving Security

To improve the strength of your protection we recommend the following:

Rename the ProInfo32.dll, ProInfo64.dll, ProFunc32.dll, and ProFunc64.dll files. Renaming the ProtectKit DLL files will make it harder for hackers to know how you have protected your applications with the ProtectKit.

Regarding the ProInfo64.dll ProFunc64.dll

The ProInfo64.dll, ProFunc64.dll are DLLs for 64 bit applications. If you are running a 32 bit application on a 64 bit operating system, you need to use the ProInfo32.dll and ProFunc32.dll.


How to Run the Win32(64) Samples

The sample programs included with the ProtectKit3.5 are intended to illustrate how you can use Password Protection in your own Win32(64) applications. The ProtectKit3 samples call various ProtectKit3 functions to retrieve information and set protection. Using these sample programs is an excellent way to understand how password protection works and how to add it to your Win32(64) applications

The following is a brief explanation of how to set password protection and also how to unlock that protection.

Step 1:

Choose a sample program and open the sample project. If an EXE has not been built, build it. If you get an error message asking for ProtectKit3.5 files, see Step 2

Step 2:

Copy the necessary ProtectKit3 files into the same folder as the EXE. These ProtectKit3 files are: ProInfo32(64).dll and the ProFunc32(64).dll. If there is no EXE, build it.

Step 3:

Set protection into the application using the Set Password Protection Tool.

a. Run the "Set Password Protection" tool (PrNETSetProtect.exe).
b. Click the "Open" button.
c. Choose the ProInfo file. This is the ProtectKit3.5 ProInfo32(64).dll that you copied to the same folder as your EXE.
(This file can be renamed for increased security.)
d. Select the PC Identifiers that you want to use to uniquely identify the PC running your application.
e. Set a lockword and protection type. For example:
Lockword: AbcdefgH
Protection Type: Standard Protection
f. Click the "Save" button at the top of the "Set Password Protection" tool.

Password protection has now been set into the ProInfo32(64).dll and into the compiled application EXE. Run the sample EXE and check the protection status by clicking the button named "Protection Status". The status is "Locked".

Step 4:

Unlock the protection application.

To unlock an application, you need to enter a valid password. Passwords are generated by the Password Generators. Here we will use the Password Generator EXE (Pr3PassGen.exe). To use the password generator, you must first retrieve the PcID from the PC. The sample programs retrieve the PcID within a button click event. Run the sample EXE that you protected in the above steps and click the button named "Get PcID (default)". The PcID will appear in the textbox.n the textbox.

Run the Password Generator (Pr3PassGen.exe).
Enter the lockword: AbcdefgH
Enter the PcID that you retrieved from the sample Exe.
Click the button named "Retrieve Password". The password will appear in the textbox.
Copy it from the Password Generator and paste it into the appropriate textbox in the sample EXE and click the button named "Set Password".

The sample Exe should be now be unlocked. Confirm this by clicking the button named "Protection Status".

Regarding the runtime environment:

The sample EXE file and the following files MUST be in the same folder:
ProInfo32(64).dll
ProFunc32(64).dll

If you are trying to run the sample on a target machine where the ProtectKit3.5 installation program was not used, you will need to be sure that the ProtectKit System Driver is installed and working on that computer. To install the ProtectKit System Driver, you need to execute the Ddscm.exe on the target machine. For details see the explanation for the ProtectKit System Driver in our online help. For details about executing the Ddscm.exe, please see Options for Ddscm.exe for Ddscm.exe.


HowToRunWin32Samples_1

ProtectKit3

How To Run Win32(64) Samples

The following is a step by step explanation for running one of the password protection sample projects in Visual Basic 6. By following these steps you will be able to run all the samples and also understand how to add password protection to your own applications.

Win32(64) Password Protection Sample "Vb6"

The following is an explanation of the Win32(64) sample program called "Vb6". It can be found in the following default Installation location:

C:\Program Files\ProtectKit3.5\Password Protection\Set Password Protection\For Win32(64)\Sample Programs (Win32-64)\32\Vb6\

For this explanation, I am using a Windows 7 32bit operating system. If running on a 64 bit operating system, your paths may be slightly different, though nothing that should cause confusion. I wanted to keep the sample programs that shipped with the ProtectKit3.5 in pristine condition so I created a new folder called "Run Pro35 Samples" at

"C:\Run Pro35 Samples\"

and then copied the ProtectKit3.5 sample project that I wanted to run into this folder.

Step 1:

Copy the entire "Vb6" folder from the installation location given above into the test folder. In my case that is the "C:\Run Pro35 Samples" directory.

Step 2:

Copy the ProFunc32.dll and the ProInfo32.dll into the same directory as the Project2.exe (by default this sample project's name is Project2.vbp for some reason). You will find the ProInfo32 file in this default installation directory:

C\Program Files\ProtectKit3.5\Password Protection\ProInfo Files\ProInfo32.dll

Note: The ProInfo32.dll is for 32 bit applications, whether they are running on a 32 or 64 bit operating system. The ProInfo64.dll is for 64 bit applications. The ProInfo32(64).dll files are the same for .NET applications or Win32(64) applications.

The ProFunc32.dll can be found in this default installation directory:

C:\Program Files\ProtectKit3.5\Password Protection\Set Password Protection\For Win32(64)\ProFunc Files (Win32-64)\ProFunc32.dll

Note: The ProFunc32.dll is for 32 bit applications built in Delphi, C++Builder, VC++, or VB6. The ProFunc64.dll is for 64 bit applications built in Delphi, C++Builder, VC++. The ProFunc32(64).dll files CANNOT be used with .NET applications. For .NET applications, use the ProFuncNET32(64).dll file.

Step 3:

Open the project in VB6. Make sure that the ProtectKit3.bas file is included in the Vb6 project as a standard module. This file gives the declarations for the ProtectKit35 DLL functions. The ProtectKit3.bas file can be found in this default installation directory:

C:\Program Files\ProtectKit3.5\Password Protection\Set Password Protection\For Win32(64)\Include Files (Win32-64)\ProtectKit3.bas

If this file is not included in the project, please add it. To do that....
1. In the Project Explorer, right click the Project, Select Add --> Module

2. Choose the Existing Tab and browse to the ProtectKit3.bas file and click Open

Step 4:

Rebuild the Project2.exe.
Close the Vb6 project.

Step 5:

Set Protection:

1. Open the Set Password Protection Tool for Win32(64) applications. This tool is called "Pr3SetProtect.exe" and can be found in this default installation location:

C:\Program Files\ProtectKit3.5\Password Protection\Set Password Protection\For Win32(64)\Set Password Protection Tool (Win32-64)\Pr3SetProtect.exe

2. Click the "Open" button, and browse to the ProInfo file that you copied above. It should be in the same directory as the Project2.exe you have just built. In my case that is here:
"C:\Run Pro35 Samples\Vb6\ProInfo32.dll"

3. Select the Exe file you are protecting. This will be the Project2.exe you just built.In my case this is here:
"C:\Run Pro35 Samples\Vb6\Project2.exe"

4. Choose the PC Indentifiers you want to use. This determines how strictly you want to define the computer's hardware signature. I am accepting the default setting which is the least restrictive.

5. Choose a Lockword. The trial version of the ProtectKit3.5 requires that you use the Lockword "AbcdefgH". I will use this also. In your applications you should choose a different lockword and keep it secret. The lockword must consist of English alphabet (a through z) and/or numbers 0 through 9. The lockword must contain at least 8 characters and cannot exceed 64 characters.

6. Choose the Protection Type. Here I am choosing Standard protection which means the application will be locked initially until it is unlocked with a password. Once unlocked, it will run indefinitely.

7. Set these protection setting into your application by clicking the Save button at the top. A messagebox will appear telling you if the protection has been set.

NOTE: You can change the name of the ProInfo32.dll file if you want to. You do this by using the Save As button. The New button is essentially the same as the Open button. If you use the Open button with an existing ProInfo32(64).dll, the Set Password Protection Tool will ask you for the Lockword. If you use the New button, it will delete all existing protection settings and start over. The results are essentially the same.

Here is a screenshot of the Set Password Protection Tool with the above settings.

For more details please refer to the explanation for the Set Password Protection Tool For Win32(64) Applications.

Step 6:

You have now set protection in this application. Try running it. Double click on the Project2.exe. You should see something like this....

At the top, the Initial Status should say, "OK". This means that the ProtectKit System Driver is properly installed and running, that the ProInfo and ProFunc files are where they should be, that the protection information embedded in the application matches that set in the proInfo file and so on. If you are getting some errors here then see the trouble shooting section.

Click the Protection Type button: It should say "Standard protection"
Click the Protection Status button: It should say, "Locked"

The other buttons, "Remaining Uses", "Remaining Days", and "Remaining Months" pertain to different protection types and are not relevant. Clicking them will return values of -1.

You can also retrieve the hardware information with this application by clicking the "Video Card", "Motherboard", "LAN Card", "Random Number", and "CPU" buttons. This information is used to create the default Pcid that indentifes the computer running this application.

Here is a screenshot showing this information:

Notice that this application is locked. To unlock the application, you need to retrieve the PcID and enter it into the Password Generator. The ProtectKit3.5 has three ways to generate passwords. In this example we will use the Pr3PassGen.exe. It can be found in the following deflault directory:

C:\Program Files\ProtectKit3.5\Password Protection\PasswordGenerators

Also in this directory, besides the Pr3PassGen.exe, you will see a Pr3PassGen.dll and Pr3PassGen.ocx. These two programable password generating intefaces let you send unlock passwords to your endusers programatically.

1. Double click the Pr3PassGen.exe.
2. Enter the Lockword, which in our case is: AbcdefgH
3. Copy the PcID from the application...To retrieve it click the GetPcID (default) button.
4. Click the Generate Password button
5. Copy the Password from the Password Generator and paste it into the application in the textbox next to the Set Password button.
6. Click the Set Password button.

This will unlock the application. To check that. Click the Protection Status button again.

The application has now been unlocked and will run indefinitely on this machine. If it is copied to another computer it will stop running.

Please try out other protection types using this sample project.

TroubleShooting:

When this application starts up, under the Form Load event, the PK3Initialize method executes. This method starts the Protectkit3.5 and tells you that:

1. The ProtectKit System Driver is working properly.
2. The protection information in the application matches the protection information in the ProInfo32.dll.
3. The lockword has been retrieved from the protection information and it has passed the check.
4. The application is running on a local drive.
5. There are no other errors.

If you get a messagebox saying this, "ProtectKit isn't working."
That means the ProtectKit System Driver is not working. This system driver is installed on the computer where you installed the ProtectKit3.5. For details about this system driver please refer to the "ProtectKit System Driver" explanation in the help file of visit our online help here: ProtectKit System Driver

If you have deployed this exe to another computer then you will need to install the ProtectKit System Driver there by executing the Ddscm.exe on that computer. You will also need to do this with your own application when you deploy it. Please refer to the explanation of the ProtectKit System driver mentioned above and to Options For DdScm.exe in the help file or here: Options For DdScm.exe

If you get a messagebox saying this, "Unable to read protection information file."
That means the ProInfo32(64).dll file is not in the same directory as the application's exe file.

If you get a messagebox saying this, "Lock word is incorrect."
The lockword retrieved from the protection information embedded in your application is either incorrect or it hasn't been set yet. This can happen if you have recompiled your EXE without resetting protection using the Set Password Protection Tool. For details about how to set protection see: Set Password Protection Tool for Win32(64)


Deploying Applications

ProtectKit3

Deploying Password Protected Win32(64) Applications

How to deploy your password protected applications:

When deploying Win32(64) applications containing ProtectKit3 functionality, the following files must be deployed with the application.

For 32-bit applications

1. ProFunc32.dll (the ProtectKit3 password protection function DLL). For added protection, it is recommended that you rename this file.
2. ProInfo32.dll (the file where protection information is stored). For added protection, it is recommended that you rename this file. To rename the ProInfo32.dll file, use the Set Password Protection tool and choose the "Save As" option
3. DdScm32.exe or the DdScm64.exe (which file will depend on the operating system environment where the application is to be installed. The DdScm32(64).exe must be registered.

If you are not sure of the operating system environment (whether 32 bit or 64 bit OS) then deploy all three files DdScm.exe, DdScm32.exe, and DdScm64.exe. (Internally, the DdScm.exe will determine the operating system and execute the proper program). In this case, the DdScm.exe, must be registered. For details about registering DdScm.exe, DdScm32.exe, or DdScm64.exe, see Options for DdScm.

For 64-bit applications

1. ProFunc64.dll(the ProtectKit3 password protection function DLL). This file can be renamed.
2. ProInfo64.dll (the file where protection information is stored). This file can be renamed. To rename the ProInfo64.dll file, use the Set Protection tool and choose the "Save As" option,
3. DdScm64.exe.The DdScm64.exe must be registered. For details about registering DdScm64.exe, see Options for DdScm.

When the above files are deployed, they must be copied to the same folder. You cannot run a protected application on FD or DVD(CD)-ROM, remote network drive, etc. The ProtectKit will only run on local hard disk. It will not run on the drive's root directory. Also, please avoid copying to certain folders that, depending on Windows user permissions, do not have write permission like Windows System folder.

Files That Cannot Be Distributed

The following files cannot be distributed under any circumstances.

Pr3SetProtect.exe (Set Password Protection Tool) 32/64 bit
Pr3PassGen.exe (Password Generator EXE) 32/64 bit
Pr3PassGen.dll (Password Generator DLL) 32/64 bit
Pr3PassGen.ocx (Password Generator OCX) 32/64 bit


PasswordGeneratingTool

ProtectKit3.5

Password Generating Tool

The Password Generating Tool

This tool, also called the Password Generator, takes the PcID received from the enduser of your application and generates a password. The password can be generated by any of the 3 available password generators;

1. The password generating EXE (Pr3PassGen.EXE)

2. The password generating DLL (Pr3PassGen.DLL)

3. The password generating OCX (Pr3PassGen.OCX)

In all three cases, the generated password is sent to the enduser and is used to unlock the application.

In the password generating EXE (the Pr3PassGen.EXE), the lockword and the retrieved enduser PcID are entered and the password is generated. In the password generating DLL (the Pr3PassGen.DLL) and the password generating OCX (the Pr3PassGen.OCX), the process is the same but these allow you to develop your own password generating tool which can be included within your application program or deployed as a seperate program.

Password Generation Flow

The Password Generator will generate passwords for all types of password protection. Be aware that some applications are protected with ordinary passwords and others with renewable passwords. For details please refer to the explanation of password types in the Password Protection page.

A. Ordinary Passwords:
When an application uses ordinary passwords, the PcID is received and a password is generated. Once this password is given to the enduser and the application can be unlocked. Once unlocked, the application will run indefinitely. There is no further need to exchange the PcID and password information between the enduser and the application vendor.

B. Renewable Passwords:
When an application uses renewable passwords, it will run for the specified number of uses, days, or months and then be locked. It can be enabled for the specified number of uses, days, or months. The PcID is received and a renewable password is generated. The password is sent to the enduser and the application is unlocked. The application runs for the specified period of time or number of uses and then stops running. If the application is to be enabled again a new renewable password must be generated. After the application has been enabled with the new password, it will run again for the specified number of uses or time. For that reason, the PcID and password must be exchanged again. Whenever the application reaches its expiration, a new renewable password must be generated.

The ability to specify and generate renewable passwords is very useful because it is this ability that allows you to rent or lease software.

* To set renewable passwords use the Set Password Protection tool.
For details, refer to Password Protection.


Password Generator (EXE)

The Password Generating Executable Program

Pr3PassGen.exe

Function

This executable program (Pr3PassGen.exe) generates a password needed to unlock the protected application.

Using the Password Generator

Run the Pr3PassGen.exe found in the Password\PasswordGenerator folder under the directory where you installed the ProtectKit3.5.

Steps:

1. Enter the lockword that was set in the application code.
2. Enter the PcID that you have received from the enduser.
3. Select a "Password Type" and click the button "Generate Password". The password will be displayed in the "Password" textbox.
Under the "Password" textbox are three radio buttons that display the "Password Type" used to create the password, i.e. a numeric password, an alpha-numeric password, or an alpha-numeric password with only uppercase letters and numbers.

The "Version" button will display the Password Generator version information.
The "Font" button will allow you to set the fonts for the text displayed in the "Lockword", "PcID", and "Password" textboxes.
The "OK" button will set the lockword and font information for the next time the password generating exe is used.


Password Generator (DLL)

The Password Generating DLL

This dll provides the password generating functionality in a Win32 dll. Use this dll to programatically generate needed passwords and send them to endusers.

Pr3PassGen.dll (for 32 bit applications)

DLL Command Declarations

Before using the Pr3PassGen.dll commands, the program which calls these commands must have a description of the DLL function declarations.

Containers and Header Files

Container | Header File Name
C++ Builder, Visual C++ | Pr3PassGen.h
Delphi | Pr3PassGen.pas
Visual Basic | Pr3PassGen.bas

DLL Function List (in Alphabetical order)

DLL Function | Explanation
PS3GetPassword | This function generates the password
PS3SendMail | This function sends email


PS3GetPassword

This DLL function generates the password.

[C++Builder/Visual C++] BOOL PS3GetPassword(LPCSTR lpszLockword, LPCSTR lpszPcID, long lPasswordType, LPSTR lpszPassword);
[Delphi] function PS3GetPassword(lpszLockword, lpszPcID: PAnsiChar; lPasswordType: Longint; lpszPassword: PAnsiChar): LongBool;
[Visual Basic] Function PS3GetPassword(ByVal lpszLockword As String, ByVal lpszPcID As String, ByVal lPasswordType As Long, ByVal lpszPassword As String) As Long

Parameters

Name | Explanation
lpszLockword | The lockword that is set in the application code.
lpszPcID | The PcID received from the enduser.
lPasswordType | The password type 0: Numeric 1: Alpha-numeric 2: Alpha-numeric (Only uppercase alphabet)
lpszPassword | The generated password In C++Builder, Visual C++, and Delphi, this is a null terminated string. In Visual Basic, this is of type String of the specified size.

Return Value

Returns True (non-zero) if successful, otherwise returns False (0).


PS3SendMail

This DLL function sends email.

[C++Builder/Visual C++] long PS3SendMail(LPCSTR lpszMailSvrAddr, LPCSTR lpszFromAddr, LPCSTR lpszFromHdr, LPCSTR lpszToAddr, LPCSTR lpszToHdr, LPCSTR lpszSubject, LPCSTR lpszMessage);
[Delphi] function PS3SendMail(lpszMailSvrAddr, lpszFromAddr, lpszFromHdr, lpszToAddr, lpszToHdr, lpszSubject, lpszMessage: PAnsiChar): Longint;
[Visual Basic] Function PS3SendMail(ByVal lpszMailSvrAddr As String, ByVal lpszFromAddr As String, ByVal lpszFromHdr As String, ByVal lpszToAddr As String, ByVal lpszToHdr As String, ByVal lpszSubject As String, ByVal lpszMessage As String) As Long

Parameters

Name | Explanation
lpszMailSvrAddr | The address of the mail server (SMTP) sending the email
lpszFromAddr | The email address of the sender
lpszFromHdr | The sender's name
lpszToAddr | The email address of the receiver
lpszToHdr | The recipent's name
lpszSubject | The subject of the email
lpszMessage | The email message (content).

Return Value

Return Value | Explanation
0 | Message Sent
1 | Must have Winsock version 1.1 or above
2 | Unable to find the SMTP mail server
3 | Unable to open mail server socket
4 | Failed to connect to mail server socket
5 | Incorrect or missing parameters
6 | Memory error
7 | Transmission error

Explanation

The PS3SendMail DLL function sends email.

In order to start a new line, you must use a newline character (i.e. LF, CR, CRLF, etc.)

If using a dial up connection, please be sure you are connected before executing this function.


Password Generator (OCX)

The Password Generating OCX

This OCX provides the password generating functionality. Use this OCX to programatically generate needed passwords and send them to endusers.

Pr3PassGen.ocx (for 32 bit applications)

Properties

Property Name | Explanation
szFromAddr | The email address of the sender
szFromHdr | The sender's name
szLockword | The lockword that is set in the application code
szMailSvrAddr | The address of the mail server (SMTP) sending the email
szMessage | The email message (content)
szPassword | The generated password
lPasswordType | The password type
szPcID | The PcID received from the enduser
szSubject | The subject of the email
szToAddr | The email address of the receiver
szToHdr | The recipent's name

Methods

Method Name | Explanation
PS3GetPassword | This method generates the password
PS3SendMail | This method sends email


szFromAddr Property

ProtectKit3.5

szFromAddr Property (Password Generator OCX)

This property sets the email address of the sender. It is used by the PS3SendMail method.

[C++Builder] controlname->szFromAddr [ = WideString ]
[Delphi] controlname.szFromAddr [ = WideString ]
[Visual Basic] controlname.szFromAddr [ = String ]
[VisualC++] controlname.SetszFromAddr(LPSTR Val)

Explanation

The szFromAddr property sets the email address of the sender. This property is used by the PS3SendMail method.

Setting the Value

This property value can be set at design time and at runtime.

Getting the Value

This property value can be retrieved at runtime.


szFromHdr Property

ProtectKit3.5

szFromHdr Property (Password Generator OCX)

This property sets the name of the sender of the email. It is used by the PS3SendMail method.

[C++Builder] controlname->szFromHdr [ = WideString ]
[Delphi] controlname.szFromHdr [ = WideString ]
[Visual Basic] controlname.szFromHdr [ = String ]
[VisualC++] controlname.SetszFromHdr(LPSTR Val)

Explanation

The szFromHdr property sets the name of sender of the email. This property is used by the PS3SendMail method.

Setting the Value

This property value can be set at design time and at runtime.

Getting the Value

This property value can be retrieved at runtime.


szLockword Property

ProtectKit3.5

szLockword Property (Password Generator OCX)

This property sets the lockword that is used to generate a password. This is the lockword set in the application code.

[C++Builder] controlname->szLockword [ = WideString ]
[Delphi] controlname.szLockword [ = WideString ]
[Visual Basic] controlname.szLockword [ = String ]
[VisualC++] controlname.SetszLockword(LPSTR Val)

Value

The lockword that has been set in the application code.

Explanation

The szLockword property sets the lockword that is used by the Password Generator OCX to generate a password. This is the lockword set in the application code.

Setting the Value

This property value can be set at design time and at runtime.

Getting the Value

This property value can be retrieved at runtime.


szMailSvrAddr Property

ProtectKit3.5

szMailSvrAddr Property (Password Generator OCX)

This property sets the address of the mail server (SMTP) sending the email. It is used by the PS3SendMail method.

[C++Builder] controlname->szMailSvrAddr [ = WideString ]
[Delphi] controlname.szMailSvrAddr [ = WideString ]
[Visual Basic] controlname.szMailSvrAddr [ = String ]
[VisualC++] controlname.SetszMailSvrAddr(LPSTR Val)

Explanation

The szMailSvrAddr property sets the address of the mail server (SMTP) sending the email. This property is used by the PS3SendMail method.

Setting the Value

This property value can be set at design time and at runtime.

Getting the Value

This property value can be retrieved at runtime.


szMessage Property

ProtectKit3.5

szMessage Property (Password Generator OCX)

This property sets the message (content) of the email. It is used by the PS3SendMail method.

[C++Builder] controlname->szMessage [ = WideString ]
[Delphi] controlname.szMessage [ = WideString ]
[Visual Basic] controlname.szMessage [ = String ]
[VisualC++] controlname.SetszMessage(LPSTR Val)

Explanation

The szMessage property sets the message (content) of the email. It is used by the PS3SendMail method.

Setting the Value

This property value can be set at design time and at runtime.

Getting the Value

This property value can be retrieved at runtime.


szPassword Property

ProtectKit3.5

szPassword Property (Password Generator OCX)

This property retrieves the password that is generated by the PS3GetPassword method.

[C++Builder] controlname->szPassword [ = WideString ]
[Delphi] controlname.szPassword [ = WideString ]
[Visual Basic] controlname.szPassword [ = String ]
[VisualC++] [ LPSTR = ]controlname.GetszPassword()

Explanation

The szPassword property retrieves the password that is generated by the PS3GetPassword method. Send this password to the enduser so that the application can be unlocked.

Setting the Value

This property value cannot be set.

Getting the Value

This property value can be retrieved at runtime.


lPasswordType Property

ProtectKit3.5

lPasswordType Property (Password Generator OCX)

This property sets the type of password that is generated by the PS3GetPassword method.

[C++Builder] controlname->lPasswordType [ = short ]
[Delphi] controlname.lPasswordType [ = Smallint ]
[Visual Basic] controlname.lPasswordType [ = Integer ]
[VisualC++] controlname.SetlPasswordType(short Val)

Value

0: Numeric (only numbers from 0 to 9)
1: Alpha-numeric (alphabet and numbers from 0 to 9)
2: Alpha-numeric (Uppercase) (upper case alphabet and numbers from 0 to 9)

Explanation

The lPasswordType property sets the type of password that is generated by the PS3GetPassword method.

Setting the Value

This property value can be set at design time and at runtime.

Getting the Value

This property value can be retrieved at runtime.


szPcID Property

ProtectKit3.5

szPcID Property (Password Generator OCX)

This property sets the PcID needed to generate a password. This PcID is received from the enduser of the application and uniquely identifies the PC. This property is used by the PS3GetPassword method.

[C++Builder] controlname->szPcID [ = WideString ]
[Delphi] controlname.szPcID [ = WideString ]
[Visual Basic] controlname.szPcID [ = String ]
[VisualC++] controlname.SetszPcID(LPSTR Val)

Value

The PcID of the enduser's PC. It is received from the enduser.

Explanation

The szPcID property sets the PcID needed to generate a password. This PcID is received from the enduser of the application and uniquely identifies the PC. This property is used by the PS3GetPassword method.

Setting the Value

This property value can be set at design time and at runtime.

Getting the Value

This property value can be retrieved at runtime.


szSubject Property

ProtectKit3.5

szSubject Property (Password Generator OCX)

This property sets the subject of the email. It is used by the PS3SendMail method.

[C++Builder] controlname->szSubject [ = WideString ]
[Delphi] controlname.szSubject [ = WideString ]
[Visual Basic] controlname.szSubject [ = String ]
[VisualC++] controlname.SetszSubject(LPSTR Val)

Explanation

The szSubject property sets the subject of the email. This property is used by the PS3SendMail method.

Setting the Value

This property value can be set at design time and at runtime.

Getting the Value

This property value can be retrieved at runtime.


szToAddr Property

ProtectKit3.5

szToAddr Property (Password Generator OCX)

This property sets the email address of the receiver. It is used by the PS3SendMail method.

[C++Builder] controlname->szToAddr [ = WideString ]
[Delphi] controlname.szToAddr [ = WideString ]
[Visual Basic] controlname.szToAddr [ = String ]
[VisualC++] controlname.SetszToAddr(LPSTR Val)

Explanation

The szToAddr property sets the email address of the receiver. This property is used by the PS3SendMail method.

Setting the Value

This property value can be set at design time and at runtime.

Getting the Value

This property value can be retrieved at runtime.


szToHdr Property

ProtectKit3.5

szToHdr Property (Password Generator OCX)

This property sets the name of the receiver of the email. It is used by the PS3SendMail method.

[C++Builder] controlname->szToHdr [ = WideString ]
[Delphi] controlname.szToHdr [ = WideString ]
[Visual Basic] controlname.szToHdr [ = String ]
[VisualC++] controlname.SetszToHdr(LPSTR Val)

Explanation

The szToHdr property sets the name of receiver of the email. This property is used by the PS3SendMail method.

Setting the Value

This property value can be set at design time and at runtime.

Getting the Value

This property value can be retrieved at runtime.


PS3GetPasswordOCX

ProtectKit3.5

PS3GetPassword Method

This method generates the password needed to unlock the application.

[C++Builder] [ BOOL = ] controlname->PS3GetPassword()
[Delphi] [ Integer = ] controlname.PS3GetPassword
[Visual Basic] [ Long = ] controlname.PS3GetPassword
[VisualC++] [ BOOL = ] controlname.PS3GetPassword()

Parameters

None

Return Value

Returns True (non-zero) if successful, otherwise returns False (0).

Explanation

The PS3GetPassword method generates the password needed to unlock the application. Before executing this method, appropriate values must be set in the szLockword, szPcID, and lPasswordType properties.

If this method is successful, the password will be set in the szPassword property.


PS3SendMailOCX

ProtectKit3.5

PS3SendMail Method

This method sends email.

[C++Builder] [ long = ] controlname->PS3SendMail()
[Delphi] [ Integer = ] controlname.PS3SendMail
[Visual Basic] [ Long = ] controlname.PS3SendMail
[VisualC++] [ long = ] controlname.PS3SendMail()

Parameters

None

Return Value

Return Value | Explanation
0 | Message Sent
1 | Must have Winsock version 1.1 or above
2 | Unable to find the SMTP mail server
3 | Unable to open mail server socket
4 | Failed to connect to mail server socket
5 | Incorrect or missing property settings
6 | Memory error
7 | Transmission error

Explanation

The PS3SendMail method sends email. It is used by the Pr3passGen.ocx to send the generated password to the enduser so that the application can be unlocked. Before executing this method, appropriate values must be set in the szMailSvrAddr, szFromAddr, szFromHdr, szToAddr, szToHdr, szSubject, and szMessage properties.

If using a dial up connection, please be sure you are connected before executing this method.


ProtectKit System Driver

The ProtectKit uses a system driver called PCID32(64) to retrieve information about the hardware configuration of the PC where your application runs. The ProtectKit takes this hardware configuration information, combines it with your protection settings and a secret "lockword", and creates the password protected application.

Note that we use the terms "ProtectKit system driver" and PCID32(64) system driver interchangably. They both refer to the same system driver.

What is the DdScm.exe?

The DdScm.exe is a program that installs the pcid32(64) system driver. The pcid32(64) system driver enables the ProtectKit core functionality, it retrieves information about the PC's hardware configuration that lets the ProtectKit uniquely identify that machine.

What does the PCID32(64) System Driver do?

This is a ProtectKit system driver installed by the ProtectKit3.5 that enables the protectkit on the PC. This driver is installed by the DdScm.exe program. The PCID32(64) driver retrieves information about that PC's hardware. The PCID32(64) writes protection information to the registry if random identifiers are used and/or if a type of protection "number of uses", "number of days" or "number of months" protection is used. The PCID32(64) writes protection information to file if random identifiers are used.

Installing your protected application:

When installing an application that includes password protection, you must install the PCID32(64) system driver on that PC. Do that by executing either of the following commands:

DdScm.exe /i
DdScm.exe /a

These commands can be executed by your application's installation program or the commands can be executed from the command line after your application is installed. Once installed, you can find the PCID32(64) device driver following these steps:

1. From the StartMenu, choose Run.
2. In the Run Dialog enter the command: msinfo32
3. This will open the System Information dialog.
4. In the left pane, under Software Environment, select System Drivers
5. Find the pcid32(64) device driver in the list in the right pane.

Uninstalling your protected application:

When uninstalling an application that includes the password protection, you should first uninstall the PCID32(64) system driver. Do that by executing the following command:

DdScm.exe /r

On Windows 32 bit / 64 bit architecture:

Regardless of whether your application is a 32 bit application or a 64 bit application, on Windows 32bit operating systems, use the DdScm32.exe and on Windows 64bit operating systems, use DdScm64.exe. Executing the DdScm.exe, will automatically run the DdScm32.exe on a 32bit Windows OS and will run the DdScm64.exe on a 64bit Windows OS.

When deploying your protected application, it is recommended that you deploy all three DdScm files: DdScm.exe, DdScm32.exe, and DdScm64.exe. However, if your application is a 64 bit application, it will only run in 64bit architecture and therefore only the DdScm64.exe is required.

For details about installing and uninstalling the PCID32(64)device driver, please refer to Options For DdScm.exe, DdScm32.exe, DdScm64.exe.


Options For DdScm.exe, DdScm32.exe, DdScm64.exe

Options For DdScm.exe, DdScm32.exe, DdScm64.exe

The following options allow you to install, delete, and automatically update the ProtectKit system driver. When executing DdScm.exe, the DdScm32.exe and/or the DdScm64.exe must be in the

1. /i Option: (DdScm.exe /i, DdScm32.exe /i, DdScm64.exe /i)

This option installs ProtectKit system driver. If ProtectKit system driver is already installed, then the "register count" is increased by 1.

2. /r Option: (DdScm.exe /r, DdScm32.exe /r, DdScm64.exe /r)

This option removes the ProtectKit system driver. If the ProtectKit system driver is already installed, then the "register count" is decreased by 1.

3. /u Option: (DdScm.exe /u, DdScm32.exe /u, DdScm64.exe /u)

This option updates the ProtectKit system driver. If the ProtectKit system driver is already installed, then the "register count" does not change.
This option is recommended when there is an updated release for DdScm32(64).exe or an updated release for the protected application.

4. /m Option: (used in conjuction with options 1 through 3.)

This option is used together with the above options 1 through 3. When this command is added to another option, a message box is displayed stating if the option was successful or not.

Regarding the "register count" mentioned for each option. The register count is useful when you have multiple protected applications running at the same time on one PC. The register tells you how many applications are currently using the ProtectKit system driver. When the /r option is executed and the register count reaches 0, the ProtectKit system driver will be uninstalled.


Steps For Network Protection

Network Protection:

Network Protection detects different instances of your application that are running simultaneously on a local network. Network protected applications transmit and receive discreet messages allowing you to count the number of instances of your application running on the network. Because your applications "communicate" with each other through the messages that are sent and received, you can confirm the authenticity of the applications on the network and disable applications if unauthorized instances are running.

The following is an example of the steps needed to enable the network protection in your application.

Local Network

Step 1: Create a program

An example of relevant ProtectKit3 code (Visual Basic)

In the program's initialization code:

   Private Sub Form_Load()
Dim Netword As String * 65
Dim NetwordLen As Long
Dim net As PROTECTKIT3NET
Dim ret As Long
net.szAppID = "12345678.VB6" & Chr$(0)
                'Set a unique id for the application
net.szMessage = Text1.Text & Chr$(0)
                'The contents of the message to transmit (i.e. product serial number, etc.)
net.lSendTime = Val(Text3.Text) ' The
                interval time (in seconds)
net.hWndHandle = Me.hWnd 'The window handle
ret = PK3NETInitialize(net, "Project1.exe",
                Netword, NetwordLen)
ret = PK3NETStartNet
End Sub

End the process:

Private Sub Form_Unload(Cancel As Integer)
PK3NETStopNet
End Sub

Use an event to check for the application on other PCs:

   Private Sub Form_Resize()
Dim ret As Long
Dim msg As PROTECTKIT3NET_MSG
'The receive the message
ret = PK3NETGetMessage(msg)
If ret <> False Then
Text2.Text =
                Left(msg.szMessage, msg.lMessageLen) 'receive the transmitted message
Text4.Text =
                Left(msg.szPcName, msg.lPcNameLen)
Text5.Text =
                Left(msg.szMacAdr, msg.lMacAdrLen)
Beep
End If
End Sub

For more details, please refer to the sample programs included with the ProtectKit3.

Step 2: Set the NetWord

(Use the Set Network Protection tool)

Setting the NetWord in your application:
You must do this whenever you rebuild your application

Be sure to keep the NetWord secret. Do not make it public!

Step 3: Attach a Digital Signature

If your application is to be digitally signed. This is the time to add the digital signature. If you are not digitally signing your application then proceed to step 4.

Step 4: Deploying your application

Include the necessary files with your application in your installer. For more details about deploying applications that use ProtectKit functionality, please refer to Deploying Applications

Some examples:

There are many ways that network protection can be used to protect your applications. In a simple example, network protection could keep multiple users from using a single license over a network. You could check to see if an instance of your application running on the network and if so prevent a second instance from starting up. It would certainly be possible to write code in your application to disable any application that attempts to run multiple instances. Or perhaps you want to allow up to a certain number of instances to run simultaneously but not to exceed that amount. That is easily accomplished as well.

Network protection, by using a common event, can transmit and receive information between instances of your application. This allows you to communicate detailed information between applications. One possible scenerio is illustrated below where unique product serial numbers are sent between applications and compared for authenticity.

One example of how to use the network protection on a network (LAN)

In the following case, we illustrate the situation where an application's serial number is used to check applications running on a network (LAN). If certain conditions are met, the application is allowed to run. If they are not met, the application is prevented from running and disabled. For this illustration we are assuming that each enduser of the application is provided with a unique serial number and that this serial number is saved in the registry when the application is installed.

*1 The Form Resize Event is common to all supported containers

In C++Builder
void __fastcall TForm1::FormResize(TObject *Sender)
In Delphi
procedure TForm1.FormResize(Sender: TObject);
In VB
Private Sub Form_Resize()
In VC++
void CProject1Dlg::OnSize(UINT nType, int cx, int cy)

*2 To set registry values

Retrieving a registry value - PK3NETGetRegistryValue()
Setting a registry value - PK3NETSetRegistryValue()
Setting a registry key - PK3NETDeleteRegistryKey()

* For more details about DLL functions, refer to PkitNet32.dll/PkitNet64.dll


About Network Protection Samples

The following illustrates the steps needed to set network protection in an application program and how to unlock that protection. For this explanation, we are using the network protection sample program that is included with the ProtectKit3.5.

Step1: Set protection

Using the Set Network Protection Tool (Pr3SetProtectNet.exe), set the NetWord into the sample program exe (Project1.exe)

Step2: Copy to network

In multiple client PCs connected on a LAN network, copy the sample program exe (Project1.exe) and the Pkitnet32(64).dll.

Step3: Start Application

Enter a message and time (in seconds), then click the Initialize button and then the Start button. Information (message, PC Name, and Network Card) will be transmitted between the applications running on the LAN network. This means that the application is being used by multiple PCs on the LAN network.

Step4: Set Application ID:

Only programs that have the same application id can communicate with each other. In this sample we set application ids according to the programming language

CBuilder6

PROTECTKIT3NET net;
StrCopy(net.szAppID, "12345678.BCB"); // Sets the unique application id

Delphi6

var
net: PROTECTKIT3NET;
begin
StrPCopy(net.szAppID, '12345678.DEL'); // Sets the unique application id

VB6

Dim net As PROTECTKIT3NET
net.szAppID = "12345678.VB6" & Chr$(0) ' Sets the unique application id

VC6

PROTECTKIT3NET net;
lstrcpy(net.szAppID, "12345678.VC6"); // Sets the unique application id

Renaming the PkitNet32(64).dll

It is recommended that you rename the PkitNet32(64).dll to increase security.

Using the PkitNet64.dll

This DLL file is to be used with 64 bit application programs. Even on a 64 bit Windows operating system, if your application program is a 32 bit application, you must use the PkitNet32.dll.

Checking for multiple instances of the application running on the same machine.

The ProtectKit3.5 network protection checks applications running on different machines on a LAN network by transmitting and receiving messages between these machines. What happens if there are multiple instances of the application running on one of the machines on this network?

Basically, the ProtectKit3.5 network protection does not check for multiple instances of an application running on the same machine. The PK3NETStartNet() function will succeed for the first instance and that application will communicate with the other applications on the network. For the second instance (and other instances) running on that machine, the PK3NETStartNet() function will fail. A problem can arise when the first instance closes. This is the instance that was communicating with the other applications on the network.

To resolve this potential pitfall of multiple instances of the application running on the same machine, you simply call the PK3NETStartNet function inside a Timer event. This will periodically initialize the network check. If the first instance of the application closes, the second instance will be initialized when the timer event calls the PK3NETStartNet function and your network protection will not be compromised.

Below is the code that we used in this sample that illustrates this.

In CBuilder6

if (PK3NETStartNet() == true)
NetStartFlag = true;
else
if (PK3NETGetError() == 1004)
Timer1->Enabled = true;

void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
// Starts network check
if (NetStartFlag == false)
NetStartFlag = PK3NETStartNet();

if (NetStartFlag == true)
Timer1->Enabled = false;
}

In Delphi6

if PK3NETStartNet = true then
begin
NetStartFlag := true;
end else begin
if PK3NETGetError = 1004 then
Timer1.Enabled := True;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
// Starts network check
if NetStartFlag = false then
NetStartFlag := PK3NETStartNet;

if NetStartFlag = true then
Timer1.Enabled := false;
end;

In VB6

ret = PK3NETStartNet
If ret = True Then
NetStartFlag = True
Else
If PK3NETGetError = 1004 Then
Timer1.Enabled = True
End If
End If

Private Sub Timer1_Timer()
' Starts network check
If NetStartFlag = False Then
NetStartFlag = PK3NETStartNet
End If
If NetStartFlag = True Then
Timer1.Enabled = False
End If
End Sub

In VC6

if (PK3NETStartNet() == TRUE) {
NetStartFlag = TRUE;
} else {
if (PK3NETGetError() == 1004) {
SetTimer(1, 10000, NULL); // 10 second interval
}
}

void CProject1Dlg::OnTimer(UINT nIDEvent)
{
// Starts network check
if (NetStartFlag == FALSE)
NetStartFlag = PK3NETStartNet();

if (NetStartFlag == TRUE) {
KillTimer(1);
}
}


Using the Set Network Protection Tool

With network protection, the Set Network Protection tool is used to set the protection information for your application running on a network.

The Set Network Protection tool

Set Network Protection

The Set Network Protection tool sets the netword into your application file. Unlike password protection, network protection does not use a ProInfo file (ProInfo32.dll/ProInfo64.dll)

The application before the Set Network Protection tool has been used

Application with no protection:

The application after the Set Network Protection tool has been used

Application with with protection:

How Network Protection Works

After creating your application, use the Set Network Protection tool. This will append the network protection information to your application executable file. There will be an increase the size of your application file by about 7KB. Network protection, by using a common event, can transmit and receive information between instances of your protected application.

Steps For Setting Network Protection

1. Run the Set Network Protection tool (Pr3SetProtectNET.exe).
2. Click on the "Open" folder icon and choose the application file that is to be protected with network protection.
3. Enter a Netword. It must consist of alpha-numeric characters and be not less that 8 characters and not more than 64 characters in length.
4. Click the "Save" button. This will save the protected application file.

IMPORTANT: Do not make the Netword public!


Deploying Network Protected Win32(64) Applications

How to deploy your network protected applications:

When deploying Win32(64) applications containing ProtectKit3 Network Protection, the following files must be deployed with the application.

For Network Protection

For 32-bit applications

PkitNet32.dll (The ProtectKit3 Network Protection DLL). For added protection, it is recommended that you rename this file.

For 64-bit applications

PkitNet64.dll (The ProtectKit3 Network Protection DLL). For added protection, it is recommended that you rename this file.

When PkitNet32.dll/PkitNet64.dll are deployed, they must be copied to the same folder as the protected application or in a folder with a valid path (like Windows System folder).

Files That Cannot Be Distributed
The following files cannot be distributed under any circumstances.

Pr3SetProtect.exe (Set Password Protection Tool) 32/64 bit
Pr3SetProtectNET.exe (Set Network Protection Tool) 32/64 bit
Pr3PassGen.exe (Password Generator EXE) 32/64 bit
Pr3PassGen.dll (Password Generator DLL) 32/64 bit
Pr3PassGen.ocx (Password Generator OCX) 32/64 bit

Network Protection does not support .NET Applications.


PkitNet32.dll/PkitNet64.dll

The following commands are used to generate network protected applications. For 32-bit applications, use the PkitNet32.dll. For 64-bit applications, use the PkitNet64.dll

Before using the PkitNet32dll/PkitNet64.dll commands, the program which calls these commands must have a copy of the description of the DLL function declarations (header files found in folder called "Include").

For added security, we recommend that you rename the PkitNet32.dll/PkitNet64.dll to make it less obvious that you are using the ProtectKit. If you rename the PkitNet32.dll/PkitNet64.dll files, you must be sure that your program points to the renamed dll files. When using Visual Basic, in the Pkit3net.bas file, change the references from "PkitNet32.dll/PkitNet64.dll" to the name of the renamed dll. In VC6, Delphi, and C++ Builder, change the LoadProtectKit3NETDll to refer to the newly renamed dll.

Containers and Header Files

Container | Header File Name
C++Builder, VisualC++ | Pkit3net.h
Delphi | Pkit3net.pas
VisualBasic | Pkit3net.bas

DLL Function List (in Alphabetical order)

Function Name | Explanation
PK3NETDeleteRegistry | Deletes the specified item from the registry
PK3NETGetError | Retrieves the error code from the Net Protection DLL
PK3NETGetMessage | Uses the Form Resize event to retrieve message information
PK3NETGetMessageE | Uses the Form Resize event to retrieve message information (Supports multiple network cards)
PK3NETGetRegistryValue | Retrieves the specified information from the registry
PK3NETInitialize | Initializes network protection and enables the network protection functions
PK3NETSetRegistryValue | Sets the specified information in the registry.
PK3NETStartNet | Starts network protection
PK3NETStopNet | Stops network protection

Structure Definition (User defined type)

(1) C++Builder,VisualC++
typedef struct {
char szAppID[13];
char szMessage[129];
long lSendTime;
HWND hWndHandle;
} PROTECTKIT3NET;
typedef PROTECTKIT3NET * PTR_PROTECTKIT3NET;

typedef struct {
char szMessage[129];
long lMessageLen;
char szPcName[65];
long lPcNameLen;
char szMacAdr[13];
long lMacAdrLen;
} PROTECTKIT3NET_MSG;
typedef PROTECTKIT3NET_MSG * PTR_PROTECTKIT3NET_MSG;

typedef struct {
char szMessage[129];
long lMessageLen;
char szPcName[65];
long lPcNameLen;
char szMacAdr[65];
long lMacAdrLen;
} PROTECTKIT3NETE_MSG;

(2) Delphi
type
PROTECTKIT3NET = Record
szAppID: array[0..12] of AnsiChar;
szMessage: array[0..128] of AnsiChar;
lSendTime: Longint;
hWndHandle: HWND;
end;

PROTECTKIT3NET_MSG = Record
szMessage: array[0..128] of AnsiChar;
lMessageLen: Longint;
szPcName: array[0..64] of AnsiChar;
lPcNameLen: Longint;
szMacAdr: array[0..12] of AnsiChar;
lMacAdrLen: Longint;
end;

PROTECTKIT3NETE_MSG = Record
szMessage: array[0..128] of AnsiChar;
lMessageLen: Longint;
szPcName: array[0..64] of AnsiChar;
lPcNameLen: Longint;
szMacAdr: array[0..64] of AnsiChar;
lMacAdrLen: Longint;
end;

(3) VisualBasic
Type PROTECTKIT3NET
szAppID As String * 13
szMessage As String * 129
lSendTime As Long
hWndHandle As Long
End Type

Type PROTECTKIT3NET_MSG
szMessage As String * 129
lMessageLen As Long
szPcName As String * 65
lPcNameLen As Long
szMacAdr As String * 13
lMacAdrLen As Long
End Type

Type PROTECTKIT3NETE_MSG
szMessage As String * 129
lMessageLen As Long
szPcName As String * 65
lPcNameLen As Long
szMacAdr As String * 65
lMacAdrLen As Long
End Type

Explanation of the PROTECTKIT3NET Member Variables:
When the PK3NETInitialize command is executed, values set in member variables are enabled and szMessage content is sent to other PCs

szAppID - use this to set the application ID (8 digits + "." + 3 digits).
Because the all the same applications running on the network will send and recieve message notification, please be sure to use the above format for the application id.
An example of the 8 digits + "." + 3 digits format is: "Newtone0.001"

szMessage - use this to set the message that is sent between PCs on the network
One possibility would be to use product serial numbers or other application identifiers as the szMessage content.

lSendTime - use this to set the time interval (in seconds) between message transmissions.

hWndHandle - set the application's window handle into this variable.

Explanation of the PROTECTKIT3NET_MSG Member Variables:
When the PK3NETGetMessage command is executed values are set into the various member variables
(The information retrieved by PK3NETGetMessage is information transmitted by other PCs existing on the same network.

szMessage refers to the message that is received.
(This is the PROTECTKIT3NET szMessage set PCs other than your own)

lMessageLen is the length of the szMessage

szPcName refers to the computer name.
(For example in Windows98, the computer name is that name for the computer set in the Control Panel / Newtork)

lPcNameLen refers to the length of the szPcName

szMacAdr is the network Mac Address

lMacAdrLen refers to the length of the szMacAdr

Explanation of the PROTECTKIT3NET_MSG Member Variables:
When the PK3NETGetMessage command is executed values are set into the member variables
(This is the information sent from PCs, other than your own, that are connected on the same network.

szMessage refers to the message that is received.
(This is the PROTECTKIT3NET szMessage transmitted by PCs other than your own)

lMessageLen is the length of the szMessage

szPcName refers to the computer name.
(For example: In Windows98, the computer name will be the computer name set in the Control Panel / Newtork)

lPcNameLen refers to the length of the szPcName

szMacAdr the network card Mac Address. Even if multiple network cards exist, this can retrieve information from only one of them.

lMacAdrLen refers to the length of the szMacAdr

Explanation of the PROTECTKIT3NETE_MSG Member Variables:
When the PK3NETGetMessageE command is executed values are set into the member variables
(This is the information sent from PCs, other than your own, that are connected on the same network.

szMessage refers to the message that is received.
(This is the PROTECTKIT3NET szMessage transmitted by PCs other than your own)

lMessageLen is the length of the szMessage

szPcName refers to the computer name.
(For example: In Windows98, the computer name will be the computer name set in the Control Panel / Newtork)

lPcNameLen refers to the length of the szPcName

szMacAdr the network card Mac Address. The can retrieve up to 5 Mac Addresses. When multiple Mac Addresses are retrieved, they will be seperated by a colon.
For example:
One Mac Address --> 001122334455 Multiple Mac Addresses --> 001122334455:66778899AABB

lMacAdrLen refers to the length of the szMacAdr

The Message flow
In this case, "Serial No = xxx" refers to the application's serial number transmitted in PROTECTKIT3NET's szMessage.


PK3NETDeleteRegistry

This function deletes the specified item from the registry.

[C++Builder/Visual C++] BOOL PK3NETDeleteRegistry(long lRegKey, LPCSTR lpszSubKey, LPCSTR lpszName);
[Delphi] function PK3NETDeleteRegistry(lRegKey: Longint; lpszSubKey, lpszName: PAnsiChar): LongBool;
[Visual Basic] Function PK3NETDeleteRegistry(ByVal lRegKey As Long, ByVal lpszSubKey As String, ByVal lpszName As String) As Long

Parameters

Name | Explanation
lRegKey | 0: HKEY_CLASSES_ROOT 1: HKEY_LOCAL_MACHINE 2: HKEY_CURRENT_USER
lpszSubKey | The registry subkey
lpszName | The registry item name

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3NETDeleteRegistry function deletes the specified item from the registry.

Depending on the value of IRegKey and on the user's permission settings, this function may be unable to delete the item from the registry. If user permissions are limited, be sure to set IRegKey to 2 (HKEY_CURRENT_USER).


PK3NETGetError

This function retrieves the error code from the Net Protection DLL.

[C++Builder/Visual C++] long PK3NETGetError(void);
[Delphi] function PK3NETGetError: Long;
[Visual Basic] Function PK3NETGetError() As Long

Parameters

None

Return Value

Value | Explanation
0 | The function executed properly (no errors generated)
1000 | The function is unable to execute while the thread is running.
1001 | The function is unable to execute while the thread is not running.
1002 | Incorrect Parameter
1003 | Initialization failed
1004 | Thread activation error (Same application attempting multiple activation)
1005 | The total length of szMessage, szPcName, and szMacAdr in PROTECTKIT3NET_MSG exceeds 255 bytes.

Explanation

The PK3NETGetError function retrieves the error code from the Net Protection DLL.


PK3NETGetMessage

This function uses the Form Resize event to retrieve message information.

[C++Builder/Visual C++] BOOL PK3NETGetMessage(PTR_PROTECTKIT3NET_MSG pMsg);
[Delphi] function PK3NETGetMessage(var pMsg: PROTECTKIT3NET_MSG): LongBool;
[Visual Basic] Function PK3NETGetMessage(pMsg As PROTECTKIT3NET_MSG) As Long

Parameters

Name | Explanation
pMsg | The parameter holding the retrieved message information in a user defined structure

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3NETGetMessage function retrieves the message information using the form's resize event. In Visual Basic this event is called Form Resize event; in Cepji/C++Builder it is OnResize event, and in Visual C++, it is called OnSize event.

For more details about the PROTECTKIT3NET_MSG, please refer to the PROTECTKIT3NET_MSG member variable explanation of the PkitNet32.dll/PkitNet64.dll.


PK3NETGetMessageE

This function uses the Form Resize event to retrieve message information.

[C++Builder/Visual C++] BOOL PK3NETGetMessageE(PTR_PROTECTKIT3NETE_MSG pMsg);
[Delphi] function PK3NETGetMessageE(var pMsg: PROTECTKIT3NETE_MSG): LongBool;
[Visual Basic] Function PK3NETGetMessageE(pMsg As PROTECTKIT3NETE_MSG) As Long

Parameters

Name | Explanation
pMsg | The parameter holding the retrieved message information in a user defined structure

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3NETGetMessageE function retrieves the message information using the form's resize event. In Visual Basic this event is called Form Resize event; in Cepji/C++Builder it is OnResize event, and in Visual C++, it is called OnSize event.

For more details about the PROTECTKIT3NETE_MSG, please refer to the PROTECTKIT3NETE_MSG member variable explanation of the PkitNet32.dll/PkitNet64.dll.


PK3NETGetRegistryValue

This function retrieves the specified information from the registry.

[C++Builder/Visual C++] BOOL PK3NETGetRegistryValue(long lRegKey, LPCSTR lpszSubKey, LPCSTR lpszName, LPTSTR lpszOut);
[Delphi] function PK3NETGetRegistryValue(lRegKey: Longint; lpszSubKey, lpszName, lpszOut: PAnsiChar): LongBool;
[Visual Basic] Function PK3NETGetRegistryValue(ByVal lRegKey As Long, ByVal lpszSubKey As String, ByVal lpszName As String, ByVal lpszOut As String) As Long

Parameters

Name | Explanation
lRegKey | 0: HKEY_CLASSES_ROOT 1: HKEY_LOCAL_MACHINE 2: HKEY_CURRENT_USER
lpszSubKey | The registry subkey
lpszName | The registry item name
lpszOut | The data referred to by lpszName

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3NETGetRegistryValue function retrieves the specified information from the registry.


PK3NETInitialize

This function initializes network protection and enables the network protection functions.

[C++Builder/Visual C++] BOOL PK3NETInitialize(PTR_PROTECTKIT3NET pNet, LPCSTR lpszAppName, LPSTR lpszNetword, LPLONG lpNetwordLen);
[Delphi] function PK3NETInitialize(var pNet: PROTECTKIT3NET; lpszAppName, lpszNetword: PAnsiChar; var lpNetwordLen: Longint): Longint;
[Visual Basic] Function PK3NETInitialize(pNet As PROTECTKIT3NET, ByVal lpszAppName As String, ByVal lpszNetword As String, lpNetwordLen As Long) As Long

Parameters

Name | Explanation
pNet | The parameter holding the retrieved message information in a user defined structure
lpszAppName | The name of the application protected by the ProtectKit
lpszNetword | The retrieved network lockword (from 8 to 64 digits) In C++Builder, Visual C++, and Delphi. this is a string terminating with Null. In Visual Basic, this is a string of specified size. (The Netword specified in the "Set Protection" tool, network protection.)
lpLockwordLen | The length of the retrieved Netword in digits

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3NETInitialize function initializes network protection and enables the network protection functions.

For more details about the PROTECTKIT3NET_MSG, please refer to the PROTECTKIT3NET_MSG member variable explanation of the PkitNet32.dll/PkitNet64.dll.


PK3NETSetRegistryValue

This function sets the specified information in the registry.

[C++Builder/Visual C++] BOOL PK3NETSetRegistryValue(long lRegKey, LPCSTR lpszSubKey, LPCSTR lpszName, LPCSTR lpszIn);
[Delphi] function PK3NETSetRegistryValue(lRegKey: Longint; lpszSubKey, lpszName, lpszIn: PAnsiChar): LongBool;
[Visual Basic] Function PK3NETSetRegistryValue(ByVal lRegKey As Long, ByVal lpszSubKey As String, ByVal lpszName As String, ByVal lpszIn As String) As Long

Parameters

Name | Explanation
lRegKey | 0: HKEY_CLASSES_ROOT 1: HKEY_LOCAL_MACHINE 2: HKEY_CURRENT_USER
lpszSubKey | The registry subkey
lpszName | The registry item name
lpszIn | The data to be set into the item specified by lpszName

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3NETSetRegistryValue function sets the specified information in the registry.

Depending on the value of IRegKey and on the user's permission settings, this function may be unable to set the information into the registry. If user permissions are limited, be sure to set IRegKey to 2 (HKEY_CURRENT_USER).


PK3NETStartNet

This function starts network protection.

[C++Builder/Visual C++] BOOL PK3NETStartNet(void);
[Delphi] function PK3NETStartNet: Longint;
[Visual Basic] Function PK3NETStartNet() As Long

Parameters

None

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3NETStartNet function starts network protection. Use this inconjunction with PK3NETStopNet


PK3NETStopNet

This function stops network protection.

[C++Builder/Visual C++] BOOL PK3NETStopNet(void);
[Delphi] function PK3NETStopNet: Longint;
[Visual Basic] Function PK3NETStopNet() As Long

Parameters

None

Return Value

Returns the True (nonzero) if successful, otherwise returns False (0).

Explanation

The PK3NETStopNet function stops network protection. Use this inconjunction with PK3NETStartNet


Increasing Security

ProtectKit3.5

Ways to Increase Security

Renaming ProInfo Files

Renaming ProFunc Files

Hiding Lockword and lockword check

Hiding Netword and Netword check

Obfuscating and encrypting strings in .NET Applications

Setting Hardware signature so that if any hardware changes the pc is determined to have changed.

Using random identifiers

Writing to registry and file system and hiding those locations

ProtectKit3.5 Home || Online Store || ProtectKit3.5 Online Help
Copyright © Newtone Corporation - All rights reserved