User's Manual

28
9 Manual protection
Manual protection is based on the use of the functions of the library of the development kit supplied by Eutronsec. The
functions for SmartKey or API are implemented both as static libraries and as dynamic libraries (DLL, in the case of
Windows). From a functional point of view, there is no difference between the two types of library. The dynamic
libraries offer a lower degree of security because an expert hacker could understand when the protected program uses
the dynamic library. This danger is cut down with static libraries because the link occurs when the executable file is
generated.
Use of the APIs and implementation of powerful protection techniques make it possible to protect your work also
against the menace of expert IT pirates with refined analysis instruments. It is very important to know these techniques,
because a hacker could overcome the security systems through a banal weak point of the code. For example, the
possibility of obtaining the Label or Password by analyzing the executable file must be absolutely avoided. The chapter
10 illustrates and gives examples of some of these protection techniques and is an essential addition to the current
chapter.
The software drivers make it possible to activate a set of commands, each of which implements one of the following
security operating modes:
Locating mode: detects if the dongle is present, and on which parallel or USB port.
Scrambling mode: algorithmically verifies if the Id-Code is correct.
Reading mode: reads the Secure Data.
Block Reading mode: reads the Secure Data in blocks.
Writing mode: writes the Secure Data.
Block Writing mode: writes the Secure Data in blocks.
Fixing mode: fixes the contents of the dongle so that they can no longer be modified.
Encryption mode: activates the coding algorithm programmed by the user.
Programming mode: reprograms the contents of the dongle.
AES mode: algorithmically authenticates the SmartKey.
The Eutronsec development kit contains the smartdem program that uses some of the commands explained in the
following paragraphs. The program is the console type, and was written in C. It can be compiled with any C compiler in
the following environments: Linux, Mac OS X 10.x and Windows.
The source code contained in smartdem.c is the same for all the operating systems, but the compiling mode is different.
This is why smartdem.c is located in the following directory:
Sdk\Manual_Protection\Standalone_Windows_Libraries_And_Examples\GenericWin32Obj\, compilation with
static linkage designed for the Windows environment.
Sdk\Manual_Protection\Others\, compilation designed for the Linux and Mac OS X 10.x environments.
9.1 Execution method of SmartKey commands
The execution method for SmartKey commands occurs through the exchange of a data field between the program and
the SmartKey driver. The data field has a fixed format and contains all information necessary for executing the
command and any result. It is defined as a structure (or record) with the following fields:
struct smartkey {
word lpt;
word command;
byte label[16];
byte password[16];
byte data[64];
word fail_counter;
word status;
byte ext_data[352];
}