Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Protecting Your

Software with
HASP HL and
HASP4 Parallel
V2.0
Contents
Introduction ....................................................................................................................................1
Accessing HASP4 and HASP HL Keys.........................................................................................2
Using the HASP Driver..................................................................................................................3
Using the HASP Envelope .............................................................................................................4
Using the HASP API......................................................................................................................4
Programming the Memory of HASP Keys.....................................................................................7
COPYRIGHTS AND TRADEMARKS
The HASP® HL system and its documentation are copyrighted (C) 1985 to present by
Aladdin Knowledge Systems Ltd. All rights reserved.

HASP is a registered trademark of Aladdin Knowledge Systems Ltd.

HASP® HL Basic, HASP® HL Pro, HASP® HL Max, HASP® HL Time,


HASP® HL Net, HASP4 Std, HASP4 M1, HASP4 M4, HASP4 Time and HASP4 Net are
trademarks of Aladdin Knowledge Systems Ltd.

All other trademarks, brands, and product names used in this guide are trademarks of their
respective owners.
Introduction

Thank you for choosing HASP HL to protect your software against unauthorized use. This short guide
describes how to combine HASP4 parallel keys with HASP HL keys to protect your software.

The HASP HL family of hardware keys includes two sub-families:


• HASP HL cross-platform keys, which connect to USB ports on PCs and Mac computers.
• HASP4 keys, which connect to the parallel ports of PCs.

Refer to this guide only if you wish to protect your software with both types of keys: HASP HL with its
advanced technology (refer also to the HASP HL Software Protection and Licensing Guide), and HASP4
parallel. If you are using HASP HL as a HASP4 key, continue using the HASP4 software and tools, and
refer to the HASP4 Programmer’s Guide for documentation.

The following table lists the various HASP4 models and their compatible HASP HL models:

HASP4 Model HASP HL Model


HASP4 Std HASP HL Basic
HASP4 M1 HASP HL Pro
HASP4 M4 HASP HL Max
HASP4 Time HASP HL Time
HASP4 Net-5 HASP HL Net-10
HASP4 Net-10 HASP HL Net-10
HASP4 Net-20 HASP HL Net-50
HASP4 Net-50 HASP HL Net-50
HASP4 Net-100 HASP HL Net-250+
HASP4 Net-unlimited HASP HL Net-250+
Note that HASP HL Net is available in 3 models.

1
To protect your software with HASP HL and HASP4 Parallel keys you need to combine the two
technologies and use tools that are available for both. These are described in the next sections of this
guide:

• HASP access mechanisms


• HASP driver
• HASP Envelope
• HASP API
• HASP memory programming and license generation

Accessing HASP4 and HASP HL Keys

HASP HL is fully backward compatible to HASP4. This means that any HASP4-protected application can
run with a HASP HL key without requiring you to modify or upgrade your software or drivers. Although
HASP HL is backward compatible to HASP4, their access mechanisms are different.

Accessing HASP Keys

¾ To access a HASP HL key you need its corresponding MASTER HASP HL key.

¾ To access a HASP4 key you need its corresponding HASP4 PASSWORDS.

According to the type of keys you order, these are your access rules:

If you have a Developer Kit and are evaluating a demo HASP HL and demo HASP4 parallel keys:
• HASP HL demo keys do not require a Master key. Therefore to access your HASP HL just use the
HASP HL tools supplied on the HASP HL software CD.
• To access your HASP4 parallel demo key use the passwords in the following table, according to the
HASP4 demo model you received:

2
HASP4 Demo Key HASP4 Passwords
HASP4 Std (DEMO3A) 5932-25657
HASP4 M1 (DEMOMA) 15417-9632
HASP4 M4 (DEMOMA) 15417-9632
HASP4 Time (DEMOMA) 15417-9632
HASP4 Net (DEMOMA) 15417-9632

If you have a Starter Kit and are using coded HASP HL and coded HASP4 parallel keys:
• To access your coded HASP HL keys use the Master key supplied in your kit.
• To access your coded HASP4 parallel keys use the HASP4 passwords supplied with your HASP4
keys.

If you are an existing HASP4 customer switching to HASP HL, and want to continue using your
HASP4 parallel keys:
• To access your coded HASP HL keys use the Master key supplied with your keys.
• To access your coded HASP4 parallel keys use the HASP4 passwords you have used so far.

NOTE:
Your Master HASP HL key and HASP4 Passwords should be supplied to you with your keys.
If you are missing one or both, please contact your local HASP representative.

Using the HASP Driver

When combining HASP HL and HASP4 technologies you need to install the HASP HL driver which
communicates with both HASP HL and HASP4 keys. The HASP HL driver can be found on the HASP
HL software CD.

3
Using the HASP Envelope

The Envelope is an automatic tool that enables protecting your software in seconds while providing a high
level of security. We recommend you always use the Envelope to provide your software extra security
measures that prevent illegal use, reverse engineering, code debugging, and other types of attacks.

The HASP HL Envelope does not support HASP4 keys. Therefore, if you’re combining HASP4 and
HASP HL you need to wrap your application files with the HASP4 Envelope. Applications protected
with the HASP4 Envelope will communicate with HASP HL keys as though they are HASP4 keys.
Although the HASP4 Envelope uses the HASP4 technology to secure your software, it is an extremely
strong and robust tool.

To obtain the latest version of the HASP4 Envelope contact you local HASP representative or download it
from the Aladdin support web page at: http://www.hasp.com/h4. Select “HASP Development and
Production Tools” and download the “HASP Envelope”.

Using the HASP API

The HASP HL API lets you customize your protection and insert calls to your protection keys throughout
your application source code.

The HASP HL API supports HASP4 keys. Therefore if you’re combining HASP HL and HASP4 parallel
keys you can use one set of API calls – the HASP HL API.

Implementing the HASP HL API is a simple process requiring the following steps:

1. Logging into a key to establish a session.


2. If login is successful you can use the HASP HL API to communicate with the key (HASP HL or
HASP4 parallel) and its resources (memory, real-time clock, etc.).
3. Logging out to close the session.

4
The HASP HL API functions are not dependent on the key models accessed or the platforms on which
they run. The login function is the gateway to HASP HL API implementation. To search for and
communicate with a HASP HL or a HASP4 parallel key, a successful login session must be established.

In order to login to a HASP key, you need to specify your Vendor Code (accessed from your Master key),
and a Feature ID into which you login. Only after a successful login call is executed, other functions can
be used to communicate with the key.

Declaring Feature IDs


The Feature ID is the corresponding ‘PROGRAM NUMBER FEATURE’ that exists inside a HASP key.
Specific features are assigned program numbers. When logging into a licensed feature, the protected
application not only checks for the presence of the HASP key, it also checks the terms of the license
contained in the key. If the license is valid, the feature is enabled.
When logging in to a program number, you provide the following details:
1. ‘PROGRAM NUMBER FEATURE’ type that species that the login is to a program number.
2. A unique program number value.
3. Specific details for the login as:
• Only local — only a local license
• Only remote — only a remote license
• Login is counted per process ID — per process
• Disable terminal server check — to run protected applications on terminal server stations
• Enable access to HASP3/HASP4 keys

Enabling Access to HASP4 keys


By default, the HASP HL system does not enable access to HASP4 keys. However, it is very easy to
override this restriction, and enable access to HASP4 keys by simply including the following in your
declaration:

HASP_ PROGNUM_OPT_CLASSIC.

5
Once you have logged into a HASP HL key and established a session, there is a wide range of HASP HL
API functions that you can utilize in building a solid protection scheme. For more about the HASP HL
API refer to the “HASP HL Software Protection and Licensing” Guide.

Checking for HASP HL and HASP4 in Your Source Code


To combine checks for HASP HL and HASP4 in your source code, use the HASP HL API and perform
the following steps:

Step 1 – Checking which HASP key is connected to the computer


Call hasp_login() with the HASP_PROGNUM_OPT_CLASSIC parameter.
Call hasp_get_sessioninfo with the HASP_KEYINFO parameter.
HASP HL is connected if the function returns the following:
<keycaps>
<hasp4/>
<aes/>
<newintf/>
</keycaps>
HASP4 is connected if the function returns the following:
<keycaps>
<hasp4/>
</keycaps>

Step 2 – Communicating with the key according to its type


• If HASP HL is connected, continue accessing the key with other API calls, encrypting and
decrypting strings, reading and writing to the memory, etc. Skip to step 3 to end the
session.
• If HASP4 is connected, use the hasp_legacy_encrypt() and the hasp_legacy_decrypt to
encode and decode data. Use hasp_read() and hasp_write() to read and write important
information to the HASP memory.
Note that the memory is divided by the API to the Main file and to the License file.

6
Step 3 – Closing the session with the HASP key.
Call the hasp_logout() to end the session with the HASP key.

Programming the Memory of HASP Keys

The HASP HL and HASP4 range of software provide you with the necessary tools used to license and
program the memory of HASP keys. HASP HL keys generally have a greater memory capacity than
HASP4 keys.

HASP HL
Model Memory Number of Licenses
Size
HASP HL Pro 112 bytes 16
HASP HL Max 4032 bytes 112
HASP HL Time 4032 bytes 8 (limited date) + 104 (limited activations)
HASP HL Net 4032 bytes 112
HASP4
Model Memory Number of Licenses
Size
HASP4 M1 112 bytes 16
HASP4 M4 496 bytes 112
HASP4 Time 512 bytes 8
HASP4 Net 496 bytes 112

HASPEdit is used to program and store licenses in the memory of HASP4 keys. For more information on
using this tool, please refer to pages 73-105 in the HASP4 Programmer’s Guide. To obtain the latest
version of the HASPEdit contact you local HASP representative or download it from the Aladdin support
web page at: http://www.hasp.com/h4. Select “HASP Development and Production Tools” and download
“HASP Edit”.

7
HASP HL Factory is used to program and store licenses in the memory of HASP HL keys. You can find
Factory on the HASPHL software CD. For more information on this tool, please refer to pages 109-126 in
the HASP HL Software Protection and Licensing Guide.

The feature IDs and program numbers that you use in HASP HL to assign licenses correspond to the
Program Numbers used with HASP4 parallel keys. For example, if you assigned your application or
module Feature ID 3 in HASP HL, the corresponding HASP4 Program Number must be 3.

You might also like