A system and method for remote code integrity in distributed systems is presented.
A server sends encrypted remote code to a client. The client receives the encrypted
remote code and a key agent from the server. The key agent includes a key to decrypt
the remote code. The client uses the key to decrypt the encrypted remote code and
stores the decrypted remote code in internal memory. The key agent uses a second
key included in the key agent to re-encrypt the decrypted remote code and stores
the re-encrypted remote code in non-volatile memory. The client executes the decrypted
remote code located in internal memory. Once the client is finished executing the
decrypted remote code, the client overwrites the keys and deletes the old encrypted code.