02.04.2013 Views

Sentinel Hardware Keys Developer's Guide - Customer Connection ...

Sentinel Hardware Keys Developer's Guide - Customer Connection ...

Sentinel Hardware Keys Developer's Guide - Customer Connection ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Scatter the Security Checks<br />

Tips and Tricks<br />

Contents Glossary Index Troubleshooting<br />

Security checks typically consist of multiple steps: calling the key, evaluating<br />

the returned value, and acting on the evaluation results. Instead of putting<br />

the entire strategy at one place in your code, you should disperse the check<br />

all over to make the relation between them not obvious. A security check is<br />

harder to break if its code components are physically separated into different<br />

sections of the application instead of being located together.<br />

Use Multiple Threads to Your Advantage<br />

If the work of an individual security check happens over multiple threads,<br />

then tracing through the operation can be complicated. This makes debugging<br />

the code very difficult.<br />

Use Returned Values as Variables<br />

One effective technique to hide security checks in a high-level language is to<br />

use returned values to control application flow. With this method, a value<br />

returned by the key becomes a logical pointer or selection key to the next<br />

execution step or subroutine. This makes analysis of your code more<br />

difficult.<br />

Another way to use a returned value is to add it to the value of a variable so<br />

the sum is the desired value of the variable. If the variable is used in other<br />

parts of the code, then that code is dependent on the call to the hardware<br />

key.<br />

For example, suppose that at some point in your application you want a<br />

variable to contain the floating value 13.0. Assume that one of the query<br />

strings you send to the key returns the decimal number 12,345.<br />

Set the floating variable to -12,332.0.<br />

Send the query.<br />

Add the response to the variable.<br />

<strong>Sentinel</strong> <strong>Hardware</strong> <strong>Keys</strong> Developer’s <strong>Guide</strong> 179

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!