ArticleslgStudy

computer science

Oblivious RAM

Oblivious RAM is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Oblivious RAM rather than just read about it. In short: An Oblivious RAM (ORAM) simulator is a compiler that transforms an algorithm in such a way that the resulting algorithm preserves the input-output behavior of the original algorithm but the distribution of the memory access patterns of the transformed algorithm is independent of the memory access pattern of the original algorithm. The use of ORAMs is motivated by the fact that an adversary can obtain nontrivial info…

Oblivious RAM — main illustration
Oblivious RAM — illustration

Key takeaways

  • Oblivious RAM belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Oblivious RAM to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Oblivious RAM from memory before moving on to harder problems.

Reference excerpt

An Oblivious RAM (ORAM) simulator is a compiler that transforms an algorithm in such a way that the resulting algorithm preserves the input-output behavior of the original algorithm but the distribution of the memory access patterns of the transformed algorithm is independent of the memory access pattern of the original algorithm. The use of ORAMs is motivated by the fact that an adversary can obtain nontrivial information about the execution of a program and the data that the program is using just by observing the pattern in which the program accesses various memory locations during its execution. An adversary can get this information even if the data in memory is encrypted. This definition is suited for settings like protected programs running on unprotected shared memory or clients running programs on their systems by accessing previously stored data on a remote server. The concept was formulated by Oded Goldreich and Rafail Ostrovsky in 1996.

Definition A Turing machine (TM), a mathematical abstraction of a real computer (program), is said to be oblivious if, for any two inputs of the same length, the motions of the tape heads remain the same. Pippenger and Fischer proved that every TM with running time T(n) can be made oblivious and that the running time of the oblivious TM is O(T(n)log⁡T(n)). A more realistic model of computation is the RAM model. In the RAM model of computation, there is a CPU that can execute the basic mathematical, logical, and control instructions. The CPU is also associated with a few registers and a physical random access memory, where it stores the operands of its instructions. The CPU also has instructions to read the contents of a memory cell and write a specific value to a memory cell. The definition of ORAMs captures a similar notion of obliviousness for memory accesses in the RAM model. Informally, an ORAM is an algorithm at the interface of a protected CPU and the physical RAM such that it acts like a RAM to the CPU by querying the physical RAM for the CPU while hiding information about the actual memory access pattern of the CPU from the physical RAM. In other words, the distribution of memory accesses of two programs that make the same number of memory accesses to the RAM is indistinguishable from each other. This description will still make sense if the CPU is replaced by a client with a small storage and the physical RAM is replaced with a remote server with a large storage capacity, where the data of the client resides. The following is a formal definition of ORAMs. Let Π denote a program requiring memory of size n when executing on an input x. Suppose that Π has instructions for basic mathematical and control operations in addition to two special instructions 𝗋𝖾𝖺𝖽(l) and 𝗐𝗋𝗂𝗍𝖾(l,v), where 𝗋𝖾𝖺𝖽(l) reads the value at location l and 𝗐𝗋𝗂𝗍𝖾(l,v) writes the value v to l. The sequence of memory cells accessed by a program Π during its execution is called its memory access pattern and is denoted by Π~(n,x). A polynomial-time algorithm C is an Oblivious RAM (ORAM) compiler with computational overhead c(⋅) and memory overhead m(⋅), if C given n∈N and a deterministic RAM program Π with memory-size n outputs a program Π0 with memory-size m(n)⋅n such that for any input x, the running-time of Π0(n,x) is bounded by c(n)⋅T where T is the running-time of Π(n,x), and there exists a negligible function μ such that the following properties hold:

Correctness: For any n∈ℕ and any string x∈{0,1}∗, with probability at least 1−μ(n), Π(n,x)=Π0(n,x). Obliviousness: For any two programs Π1,Π2, any n∈ℕ and any two inputs, x1,x2∈{0,1}∗ if |Π~1(n,x1)|=|Π~2(n,x2)|, then Π~1'(n,x1) is μ-close to Π~2'(n,x2) in statistical distance, where Π1'=C(n,Π1) and Π2'=C(n,Π2). Note that the above definition uses the notion of statistical security. One can also have a similar definition for the notion of computational security.

History of ORAMs ORAMs were introduced by Goldreich and Ostrovsky, where the key motivation was stated as providing software protection from an adversary who can observe a program's memory access pattern (but not the contents of the memory). The main result in this work is that there exists an ORAM compiler that uses O(n) server space and incurs a running time overhead of O(log3n) when making a program that uses n memory cells oblivious. There are several attributes that need to be considered when comparing various ORAM constructions. The most important parameters of an ORAM construction's performance are the client-side space overhead, server-side space overhead, and the time overhead required to make one memory access. Based on these attributes, the construction of Asharov et al., called "OptORAMa", is the first optimal ORAM construction. It achieves O(1) client storage, O(n) server storage, and O(log⁡n) access overhead, matching the known lower bounds. Another important attribute of an ORAM construction is whether the access overhead is amortized or worst-case. Several earlier ORAM constructions have good amortized access overhead guarantees but have Ω(N) worst-case access overheads. Some ORAM constructions with polylogarithmic worst-case computational overheads are. The constructions of were in the random oracle model, where the client assumes access to an oracle that behaves like a random function and returns consistent answers for repeated queries. Access to the oracle could be replaced by a pseudorandom function whose seed is a secret key stored by the client, if one assumes the existence of one-way functions. The papers were aimed at removing this assumption completely. The authors of also achieve an access overhead of O(log3n) While most of the earlier works focus on proving security computationally, there are more recent works that use the stronger statistical notion of security. One of the only known lower bounds on the access overhead of ORAMs is due to Goldreich et al. They show a Ω(log⁡n) lower bound for ORAM access overhead, where n is the data size. Another lower bound is by Larsen and Nielsen. There is also a conditional lower bound on the access overhead of ORAMs due to Boyle et al. that relates this quantity with that of the size of sorting networks.

ORAM constructions

… excerpt ends here. Continue reading the full article.

Illustrations

Oblivious RAM: An illustration of the memory of the oblivious program showing the binary tree and position map.
An illustration of the memory of the oblivious program showing the binary tree and position map.

Worked examples

Example 1 — a first encounter with Oblivious RAM

Start with the simplest possible case. Write down what Oblivious RAM claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Oblivious RAM before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Oblivious RAM ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Oblivious RAM

In research
Oblivious RAM appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Oblivious RAM in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Oblivious RAM is common in secondary-school and first-year university syllabi. It links to neighbouring topics Analysis of algorithms, Cache (computing), Models of computation, so understanding it makes those chapters shorter.
In everyday life
Look for Oblivious RAM outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Oblivious RAM” →

How to study Oblivious RAM in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Oblivious RAM means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Oblivious RAM out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Oblivious RAM in simple terms?

An Oblivious RAM (ORAM) simulator is a compiler that transforms an algorithm in such a way that the resulting algorithm preserves the input-output behavior of the original algorithm but the distribution of the memory access patterns of the transformed algorithm is independent of the memory access p…

Why does Oblivious RAM matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Oblivious RAM?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Oblivious RAM.

Tags

  • Analysis of algorithms
  • Cache (computing)
  • Models of computation

Keep exploring