A new ((n)th) black box is produced for a digital rights management (DRM)
system. The (n)th black box is for being installed in and for performing
decryption and encryption functions in the DRM system. The (n)th black
box is produced and delivered to the DRM system upon request and includes
a new ((n)th) executable and a new ((n)th) key file. The (n)th key file
has a new ((n)th) set of black box keys and a number of old sets of black
box keys. The request includes an old ((n-1)th) key file having the old
sets of black box keys. A code optimizer/randomizer receives a master
executable and randomized optimization parameters as inputs and produces
the (n)th executable as an output. A key manager receives the (n-1)th key
file and the (n)th set of black box keys as inputs, extracts the old sets
of black box keys from the (n-1)th key file, and produces the (n)th key
file including the (n)th set of black box keys and the old sets of black
box keys as an output. The (n)th executable and the (n)th key file are
forwarded to the requesting DRM system.