1. A method for executing code securely in a computer having a cache memory, the method comprising: downloading a code into the cache memory of the computer in which the code is to be executed; encrypting the downloaded code in the cache memory; locking down the cache memory contents including the encrypted code to a main memory in the computer by one of using interrupt behavior, locking down the cache lines and putting the cache into write back mode; decrypting, using a decryption algorithm in the cache memory, the encrypted code to obtain a decrypted code that is resident only in the cache memory; executing, in the cache memory, the decrypted code in the cache to generate a result; forwarding the generated result to a user; and destroying the decrypted code in the cache memory.