ROCKEY2 Software Developer's Guide
ROCKEY2 Software Developer's Guide
Table of Contents
i
ROCKEY2 Software Developer’s Guide
ROCKEY2 has 2560 bytes of Read/Write memory spaces ,which is much bigger than most of
other software protection dongles.
ROCKEY2 is an HID device so there is no driver required for supported Linux or Windows
platforms.
Each ROCKEY2 has a globally unique hardware ID.
Multiple ROCKEY2s can work together on the same computer.
ROCKEY2 supports USB only.
Each ROCKEY2 dongle contains a User ID (UID) as well as the globally unique Hardware ID
(HID). Both the UID and HID are defined as 32-bit DWORD. The UID and HID are identifiers for
the ROCKEY2 dongle.
The default UID is “0”. While the UID remains at default you may open and read/write to the
dongle memory. But you cannot obtain the HID. The HID is shielded while the UID is set to the
default. The shielded HID will return a value of “0”. The correct HID may be obtained only after
the developer resets the UID.
When generating the UID, a 64 bytes string is required as seed code. The UID will be derived
from this seed code. The UID generation is performed within the dongle hardware. The process is
absolutely irreversible, which means only the user generated the UID knows which seed code is
his UID derived from. Even hacker knows UID and knows how to use UID generating program,
as he do not know the seed code, he can not reproduce the dongle with the same UID.
Additionally, software vendor can determine whether the store zone is writable or not when
generating the UID. If the dongle is set to unwritable, the entire memory zone will be written
protected.
ROCKEY2 Driver
The ROCKEY2 dongle is a USB device that uses the driver native to the Windows and Linux
operating systems. When the dongle is inserted into the USB port, the operating system will
prompt you for installing the new device. With Windows 98 you may need the Win98 installation
CD-ROM. You will not need a CD-ROM or other storage media for Win Me/2000/XP – the driver
will install automatically.
The operating system combines the UID and HID to identify the dongle and install its driver.
When a dongle is first plugged into the computer, you will need to go through the driver
installation process. When you reset the UID, the computer will see it as a new device and you
will have to go through the process again. Once the UID is set the computer will record the new
1
ROCKEY2 Software Developer’s Guide
UID/HID combination and you will not have to reinstall the driver. Keep in mind that since each
dongle has a unique HID, and the operating system will check the combination of UID and HID,
every new dongle inserted into the computer will require installation of its driver. However, once
the driver is installed for a specific UID/ HID combination, the dongle may be removed and
reinserted to the computer without reinstalling the driver.
Please note that the driver installation process is triggered by the dongle being inserted into the
computer. When you change the UID, please remove and reinsert the dongle to install the driver
for the new UID/HID combination.
ROCKEY2 is initially preformatted with UID=0 and the HID shielded so that HID=0. The
computer operating system will see these “out of the box” dongles as device “00”. You should
reset the UID so that the operating system can see a unique UID/HID combination. The UID needs
to be reset for multiple dongles to work together on the same computer. The UID should certainly
be reset before the dongle is re-shipped and the UID generation call should not be included in the
package sent to the end users.
2
ROCKEY2 Software Developer’s Guide
EXTERN_C int WINAPI RY2_GenUID(int handle, DWORD* uid, char* seed, int isProtect)
Input Handle Dongle handle. It is the handle returned from RY2_Open
Uid Output parameter. The generated UID
Seed Seed to generate UID. It is a character string with the maximum
length of 64 bytes
isProtect Sets write protection. 0=dongle not write protected, 1=dongle write
protected.
We defines two MACROs:
#define ROCKEY2_DISABLE_WRITE_PROTECT 0
#define ROCKEY2_ENSABLE_WRITE_PROTECT 1
Return Error code. Please refer to Chapter 4 Error Codes
3
ROCKEY2 Software Developer’s Guide