Data privacy is a huge problem in cloud computing applications that require sensitive data to be stored and computed upon in the cloud. Computation requires the data to be exposed to the cloud servers, which may be attacked by malicious applications, hypervisors, operating systems or insiders. Encrypted computation has the potential to solve the data privacy problem. In encrypted computation, the user specifies encrypted inputs to a program, and the server computes on encrypted inputs to produce an encrypted result. This encrypted result is sent back to the user who decrypts it to get the actual result. The Inventors have developed Ascend, a secure processor architecture that supports private computation of arbitrary programs.