A method and apparatus for protecting computer software from unauthorized execution
or duplication using a hardware key is disclosed. The apparatus comprises a means
for communicating with the computer to receive command messages from the computer
in the hardware key and to provide response messages to the computer, a memory
for storing data for translating command messages into response messages enabling
software execution, and a processor coupled to the communicating means for translating
command messages into response messages using the data stored in the memory. The
processor further comprises a memory manager, including means for logically segmenting
the memory storing the data into at least one protected segment, and a means for
controlling access to the protected segment.