OblivLib
OblivLib implements oblivious RAM, oblivious maps and oblivious graphs for a client/server setting: the client holds the keys and runs the algorithm, and the server only stores encrypted data.
Schemes
| Kind | Scheme | Class |
|---|---|---|
| ORAM | Path ORAM | PathOram |
| Recursive Path ORAM | RecursivePathOram |
|
| Freecursive ORAM, with probabilistic resets by default | FreecursiveOram |
|
| DAORAM | DAOram |
|
| Multi-path Path ORAM | MulPathOram |
|
| Static Path ORAM (PRF-positioned; reveals repeated accesses, a building block) | StaticOram |
|
| OMAP | AVL-tree OMAP | AVLOmap |
| B+-tree OMAP | BPlusOmap |
|
| ORAM + search tree | OramOstOmap |
|
| Group-by-hash OMAP | GroupOmap |
|
| Graph | GraphOS | GraphOS |
| Grove | Grove |
Installation
Requires Python 3.12 or later.
pip install oblivlib
For development: pip install -e . --group dev, then pytest --cov (the suite requires 100% line and
branch coverage).
Usage
Everything is imported from oblivlib. Every scheme is built from its config (PathOramConfig,
AvlOmapConfig, GroveConfig, ...). A config sets the size (num_data, data_size, and key_size for maps), the
client that reaches the server, and optionally an encryptor and tuning options. Invalid settings raise
when the config is created.
from oblivlib import AesGcm, AVLOmap, AvlOmapConfig, Client, PathOram, PathOramConfig
with Client.local() as client:
oram = PathOram(PathOramConfig(num_data=1024, data_size=16, client=client, encryptor=AesGcm()))
oram.init_server_storage()
oram.operate_on_key(3, b"hello")
assert oram.operate_on_key(3) == b"hello"
omap = AVLOmap(AvlOmapConfig(num_data=1024, key_size=16, data_size=16, client=client, encryptor=AesGcm()))
omap.init_server_storage()
omap.insert(b"alice", b"42")
assert omap.search(b"alice") == b"42"
Keys and values are bytes (ORAM keys are ints in [0, num_data), graph vertices are ints); anything outside
a scheme's limits raises ContractError before the server is touched.
Client.local() runs the server in the same process. For a real deployment, run a server and connect to it.
The server has no authentication, so bind it to a trusted network or put it behind an authenticated tunnel:
from oblivlib import StorageServer, ZmqListener, serve
serve(ZmqListener("tcp://*:5555"), StorageServer(storage_dir="/var/lib/oblivlib"))
client = Client.connect("tcp://server-host:5555")
Runnable versions are in demo/: python demo/server.py, then python demo/client.py.
Metrics
client.metrics counts rounds, bytes and time (server, network, encryption) across every scheme on that
client, and with client.measure() as m: gives the same numbers for one span of work in m.result.
Citation
If OblivLib is useful in your work, please cite our papers:
@article{cao2024oblivious,
title = {Towards Practical Oblivious Map},
author = {Cao, Xinle and Feng, Weiqi and Liu, Jian and Zhou, Jinjin and Fang, Wenjing and Wang, Lei and
Xu, Quanqing and Yang, Chuanhui and Ren, Kui},
journal = {Proceedings of the VLDB Endowment},
volume = {18},
number = {3},
pages = {688--701},
year = {2024},
doi = {10.14778/3712221.3712235}
}
@article{feng2026grove,
title = {Enabling Index-free Adjacency in Oblivious Graph Processing with Delayed Duplications},
author = {Feng, Weiqi and Cao, Xinle and O'Neill, Adam and Yang, Chuanhui},
journal = {Proceedings of the VLDB Endowment},
volume = {19},
number = {8},
pages = {1826--1839},
year = {2026},
url = {https://www.vldb.org/pvldb/vol19/p1826-cao.pdf}
}
Metadata
Release files for oblivlib 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oblivlib-0.1.0.tar.gz | 60.7 kB | With provenance | Details for oblivlib-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oblivlib-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for oblivlib-0.1.0-py3-none-any.whl |
Total release size: 136.2 kB
Release files / oblivlib-0.1.0.tar.gz
| Download URL | oblivlib-0.1.0.tar.gz |
|---|---|
| Size | 60.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25396ec18bd5539a8ffdfa849937a0b83d976c9ffa738555d2531bdc5c4b4153
|
|
BLAKE2b-256 checksum How to use checksums |
d1c62ff4cfeed9d624e4e0679fd9896707897ae58ed3647cf88c50f75a6871d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / oblivlib-0.1.0-py3-none-any.whl
| Download URL | oblivlib-0.1.0-py3-none-any.whl |
|---|---|
| Size | 75.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80f5049102c6166079cc1c7ae4f01d568917f1fd7ea840bac45bb24de8c59db6
|
|
BLAKE2b-256 checksum How to use checksums |
bd18d267413c0ba2720f6f57b1ce19970cd11d1d1643db9f8bf39006238412e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for oblivlib 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for oblivlib-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.