{"id":591,"date":"2022-03-18T01:27:54","date_gmt":"2022-03-17T16:27:54","guid":{"rendered":"https:\/\/derrylab.com\/?p=591"},"modified":"2022-03-18T01:27:54","modified_gmt":"2022-03-17T16:27:54","slug":"now-i-understand-what-is-oblivious-ram","status":"publish","type":"post","link":"https:\/\/blog.derrylab.com\/index.php\/2022\/03\/18\/now-i-understand-what-is-oblivious-ram\/","title":{"rendered":"Now I Understand: What is Oblivious RAM?"},"content":{"rendered":"\n<p>ORAM is the acronym of an Oblivious Random-Access Machine.<\/p>\n\n\n\n<p>The main idea is to hide the access patterns from attackers.<\/p>\n\n\n\n<p>For example, when a client tries to access data stored in the server, the server cannot gain any information about the user access pattern.<\/p>\n\n\n\n<p>Imagine data storage, where each data is inside a block, and that block is inside a node (or bucket.)<\/p>\n\n\n\n<p>Each node (or bucket) may have multiple blocks inside or even none.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"756\" src=\"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-5.png?resize=1024%2C756&#038;ssl=1\" alt=\"\" class=\"wp-image-593\" srcset=\"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-5.png?resize=1024%2C756&amp;ssl=1 1024w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-5.png?resize=300%2C221&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-5.png?resize=768%2C567&amp;ssl=1 768w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-5.png?resize=1536%2C1134&amp;ssl=1 1536w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-5.png?resize=2048%2C1511&amp;ssl=1 2048w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption>ORAM Storage Structure <\/figcaption><\/figure>\n\n\n\n<!--more-->\n\n\n\n<p>Now to access a block, there is a path.<\/p>\n\n\n\n<p>And the client (who wants to access it) has a map for it, called Position Map.<\/p>\n\n\n\n<p>The position map has information about the block&#8217;s position. Each block has its block&#8217;s position information.<\/p>\n\n\n\n<p>So when a client wants to access, say block 7, then it will look into the position map where is the location of block 7.<\/p>\n\n\n\n<p>Then how does it traverse the path? There are two principles.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Principle A<\/strong>: Push the blocks as deep as possible. Try the deepest node first. If already full, try upper level node. But when all nodes is full, then store it in the stash.<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Principle B<\/strong>: Block should be always in the same path from its position.<\/li><\/ul>\n\n\n\n<p>Let&#8217;s continue with our example, the client wants to write block 7.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"535\" src=\"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-4.png?resize=1024%2C535&#038;ssl=1\" alt=\"\" class=\"wp-image-592\" srcset=\"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-4.png?resize=1024%2C535&amp;ssl=1 1024w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-4.png?resize=300%2C157&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-4.png?resize=768%2C401&amp;ssl=1 768w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-4.png?resize=1536%2C803&amp;ssl=1 1536w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-4.png?resize=2048%2C1070&amp;ssl=1 2048w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption>The client wants to access block 7<\/figcaption><\/figure>\n\n\n\n<ol class=\"wp-block-list\"><li>Lookup block position<\/li><li>Read the entire path, in this case, 1 -> 7 -> 13 -> 10 -> 6. These block is stored in stash<\/li><li>Now client can modify data in 7th block.<\/li><li>The client assign new random position for the block.<\/li><li>Finally write path back to different node position but in the still in the same path as before.<\/li><\/ol>\n\n\n\n<p>Here is the example case with different blocks, both access patterns are indistinguishable.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"745\" src=\"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-6.png?resize=1024%2C745&#038;ssl=1\" alt=\"\" class=\"wp-image-594\" srcset=\"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-6.png?resize=1024%2C745&amp;ssl=1 1024w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-6.png?resize=300%2C218&amp;ssl=1 300w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-6.png?resize=768%2C559&amp;ssl=1 768w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-6.png?resize=1536%2C1117&amp;ssl=1 1536w, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/image-6.png?resize=2048%2C1490&amp;ssl=1 2048w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption>Same access patterns on different block access<\/figcaption><\/figure>\n\n\n\n<p>That&#8217;s it for the simple explanation of ORAM!<\/p>\n\n\n\n<p>I hope it&#8217;s useful for your quick understanding. \ud83d\ude42<\/p>\n\n\n\n<p>Credits: Slides taken from my <a rel=\"noreferrer noopener\" href=\"https:\/\/sites.google.com\/view\/csl-pnu\" data-type=\"URL\" data-id=\"https:\/\/sites.google.com\/view\/csl-pnu\" target=\"_blank\">Professor<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ORAM is the acronym of an Oblivious Random-Access Machine. The main idea is to hide the access patterns from attackers. For example, when a client tries to access data stored in the server, the server cannot gain any information about the user access pattern. Imagine data storage, where each data is inside a block, and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":595,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5,149,118],"tags":[151,150,64,128],"class_list":["post-591","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","category-security","category-understanding","tag-oblivious-ram","tag-oram","tag-tutorial","tag-understanding"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/harrison-broadbent-ING1Uf1Fc30-unsplash-1.jpg?fit=1920%2C1080&ssl=1","jetpack-related-posts":[{"id":4555,"url":"https:\/\/blog.derrylab.com\/index.php\/2025\/06\/28\/how-to-attach-additional-block-volume-in-oracle-cloud-instance\/","url_meta":{"origin":591,"position":0},"title":"How to Attach Additional Block Volume in Oracle Cloud Instance","author":"derry","date":"June 28, 2025","format":false,"excerpt":"As I continued rolling out new features across several services in my infrastructure, I noticed disk space was starting to run low. Fortunately, my Oracle Cloud instance still had some unallocated block volume available, but since I wasn\u2019t too familiar with the Oracle Cloud Console, I had to figure things\u2026","rel":"","context":"In &quot;linux&quot;","block_context":{"text":"linux","link":"https:\/\/blog.derrylab.com\/index.php\/category\/linux\/"},"img":{"alt_text":"black internal hdd on black surface","src":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/pexels-photo-117729.jpeg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/pexels-photo-117729.jpeg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/pexels-photo-117729.jpeg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/pexels-photo-117729.jpeg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2025\/06\/pexels-photo-117729.jpeg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3171,"url":"https:\/\/blog.derrylab.com\/index.php\/2023\/12\/18\/how-to-enable-browsing-when-you-have-ssh-access\/","url_meta":{"origin":591,"position":1},"title":"How to Enable Browsing when You Have SSH Access","author":"derry","date":"December 18, 2023","format":false,"excerpt":"Introduction If you have access to SSH into a machine, it means you have full control of that machine. However if not all of the things can be done via terminal SSH, sometimes you need to browse some sites using that machine connection. The simplest solution for this is to\u2026","rel":"","context":"In &quot;linux&quot;","block_context":{"text":"linux","link":"https:\/\/blog.derrylab.com\/index.php\/category\/linux\/"},"img":{"alt_text":"view of tunnel","src":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/12\/pexels-photo-249097.jpeg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/12\/pexels-photo-249097.jpeg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/12\/pexels-photo-249097.jpeg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/12\/pexels-photo-249097.jpeg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/12\/pexels-photo-249097.jpeg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":2572,"url":"https:\/\/blog.derrylab.com\/index.php\/2023\/02\/08\/how-to-install-the-latest-openwrt-on-arduino-yun\/","url_meta":{"origin":591,"position":2},"title":"How to Install the Latest OpenWRT on Arduino Yun","author":"derry","date":"February 8, 2023","format":false,"excerpt":"By the time I am writing this, this might be the first article that tells you how to install OpenWRT on Arduino Yun because no one talks about it. Also, Arduino Yun is already reached its end of life, and the version history is not well documented in each article\u2026","rel":"","context":"In &quot;Hardware&quot;","block_context":{"text":"Hardware","link":"https:\/\/blog.derrylab.com\/index.php\/category\/hardware\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/02\/ArduinoYunFront_2.jpg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/02\/ArduinoYunFront_2.jpg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/02\/ArduinoYunFront_2.jpg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/02\/ArduinoYunFront_2.jpg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2023\/02\/ArduinoYunFront_2.jpg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":7,"url":"https:\/\/blog.derrylab.com\/index.php\/2020\/03\/18\/hello-world-2\/","url_meta":{"origin":591,"position":3},"title":"In The Name of Allah","author":"derry","date":"March 18, 2020","format":false,"excerpt":"Bismillah, Hi, welcome to my personal page. My name Derry Pratama, or you can call me Ibnu Dias, and also known as Abu Maryam. From now on, this will become my personal logging place while studying in PNU Korea. This server runs by Infosec laboratory PC with Intel Core i9-9900K\u2026","rel":"","context":"In &quot;Islam &amp; Sunnah&quot;","block_context":{"text":"Islam &amp; Sunnah","link":"https:\/\/blog.derrylab.com\/index.php\/category\/islam-sunnah\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":135,"url":"https:\/\/blog.derrylab.com\/index.php\/2020\/11\/18\/how-to-start-a-fresh-raspberry-pi-without-monitor\/","url_meta":{"origin":591,"position":4},"title":"How to Start a Fresh Raspberry Pi without Monitor","author":"derry","date":"November 18, 2020","format":false,"excerpt":"I mean using SSH because HDMI, mouse, keyboard, and monitor will eat up the whole space in my desk. Prepare the Raspberry Pi OS Firstly we need to get our microSD card with bootable Raspberry Pi OS. I recommend using Raspberry Pi Imager to make this process easier. We just\u2026","rel":"","context":"In &quot;linux&quot;","block_context":{"text":"linux","link":"https:\/\/blog.derrylab.com\/index.php\/category\/linux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2020\/11\/image.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2020\/11\/image.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2020\/11\/image.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":552,"url":"https:\/\/blog.derrylab.com\/index.php\/2022\/03\/15\/how-to-run-linux-on-riscv-in-arty-a7-100t-fpga\/","url_meta":{"origin":591,"position":5},"title":"How to Run Linux on RISCV in Arty A7-100T FPGA","author":"derry","date":"March 15, 2022","format":false,"excerpt":"It's been tempting for me to try running open-source software on top of open-source hardware. SiFive provides a bitstream for Arty A7 called Freedom, but it seems that the repository is dead now. The other interesting alternative to try is VexRiscv, and everyone keeps posting about Arty A7 35T while\u2026","rel":"","context":"In &quot;linux&quot;","block_context":{"text":"linux","link":"https:\/\/blog.derrylab.com\/index.php\/category\/linux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/pexels-rone-ferreira-3690005-1-scaled.jpg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/pexels-rone-ferreira-3690005-1-scaled.jpg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/pexels-rone-ferreira-3690005-1-scaled.jpg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/pexels-rone-ferreira-3690005-1-scaled.jpg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/blog.derrylab.com\/wp-content\/uploads\/2022\/03\/pexels-rone-ferreira-3690005-1-scaled.jpg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/posts\/591","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/comments?post=591"}],"version-history":[{"count":1,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/posts\/591\/revisions"}],"predecessor-version":[{"id":596,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/posts\/591\/revisions\/596"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/media\/595"}],"wp:attachment":[{"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/media?parent=591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/categories?post=591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.derrylab.com\/index.php\/wp-json\/wp\/v2\/tags?post=591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}