{"id":37649425,"url":"https://github.com/nthparty/oprf","last_synced_at":"2026-01-16T11:30:33.009Z","repository":{"id":57449334,"uuid":"297516562","full_name":"nthparty/oprf","owner":"nthparty","description":"Oblivious pseudo-random function (OPRF) protocol functionality implementations based on Curve25519 primitives, including both pure-Python and libsodium-based variants.","archived":false,"fork":false,"pushed_at":"2023-06-11T18:59:43.000Z","size":2907,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-02T23:20:12.064Z","etag":null,"topics":["cryptographic-algorithms","cryptographic-library","elliptic-curve-cryptography","mpc","multi-party-computation","multiparty-computation","oblivious","oblivious-pseudorandom-function","oblivious-pseudorandom-functions","oblivious-pseudorandom-generator","oblivious-pseudorandom-generators","oprf","prf","pseudo-random-function","pseudo-random-functions","pseudorandom-function","pseudorandom-functions","pseudorandom-generator","pseudorandom-generators","python-library"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/oprf","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nthparty.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-22T02:43:06.000Z","updated_at":"2023-11-23T09:37:23.000Z","dependencies_parsed_at":"2022-09-14T07:22:19.936Z","dependency_job_id":null,"html_url":"https://github.com/nthparty/oprf","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nthparty/oprf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthparty%2Foprf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthparty%2Foprf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthparty%2Foprf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthparty%2Foprf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nthparty","download_url":"https://codeload.github.com/nthparty/oprf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthparty%2Foprf/sbom","scorecard":{"id":697704,"data":{"date":"2025-08-11","repo":{"name":"github.com/nthparty/oprf","commit":"41a296f370df673e60779a988d5f4c726d9c7a1f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint-test-cover-docs.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/nthparty/oprf/lint-test-cover-docs.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint-test-cover-docs.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/nthparty/oprf/lint-test-cover-docs.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/lint-test-cover-docs.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/lint-test-cover-docs.yml:33","Warn: pipCommand not pinned by hash: .github/workflows/lint-test-cover-docs.yml:41","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/lint-test-cover-docs.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T04:12:58.016Z","repository_id":57449334,"created_at":"2025-08-22T04:12:58.016Z","updated_at":"2025-08-22T04:12:58.016Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptographic-algorithms","cryptographic-library","elliptic-curve-cryptography","mpc","multi-party-computation","multiparty-computation","oblivious","oblivious-pseudorandom-function","oblivious-pseudorandom-functions","oblivious-pseudorandom-generator","oblivious-pseudorandom-generators","oprf","prf","pseudo-random-function","pseudo-random-functions","pseudorandom-function","pseudorandom-functions","pseudorandom-generator","pseudorandom-generators","python-library"],"created_at":"2026-01-16T11:30:32.942Z","updated_at":"2026-01-16T11:30:33.002Z","avatar_url":"https://github.com/nthparty.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"====\noprf\n====\n\nOblivious pseudo-random function (OPRF) protocol functionality implementations based on `Curve25519 \u003chttps://cr.yp.to/ecdh.html\u003e`__ and the `Ristretto \u003chttps://ristretto.group\u003e`__ group.\n\n|pypi| |readthedocs| |actions| |coveralls|\n\n.. |pypi| image:: https://badge.fury.io/py/oprf.svg\n   :target: https://badge.fury.io/py/oprf\n   :alt: PyPI version and link.\n\n.. |readthedocs| image:: https://readthedocs.org/projects/oprf/badge/?version=latest\n   :target: https://oprf.readthedocs.io/en/latest/?badge=latest\n   :alt: Read the Docs documentation status.\n\n.. |actions| image:: https://github.com/nthparty/oprf/workflows/lint-test-cover-docs/badge.svg\n   :target: https://github.com/nthparty/oprf/actions/workflows/lint-test-cover-docs.yml\n   :alt: GitHub Actions status.\n\n.. |coveralls| image:: https://coveralls.io/repos/github/nthparty/oprf/badge.svg?branch=main\n   :target: https://coveralls.io/github/nthparty/oprf?branch=main\n   :alt: Coveralls test coverage summary.\n\nPurpose\n-------\nThis library provides data structures and methods for a basic `oblivious pseudo-random function (OPRF) \u003chttps://en.wikipedia.org/wiki/Pseudorandom_function_family\u003e`__ protocol. Method implementations rely on cryptographic primitives involving the `Ristretto \u003chttps://ristretto.group\u003e`__ group that are exported by the `oblivious \u003chttps://pypi.org/project/oblivious\u003e`__ library. By default, these are wrappers for functions found in the subset of the `libsodium \u003chttps://github.com/jedisct1/libsodium\u003e`__ library that is bundled with the `rbcl \u003chttps://pypi.org/project/rbcl\u003e`__ library.\n\nInstallation and Usage\n----------------------\nThis library is available as a `package on PyPI \u003chttps://pypi.org/project/oprf\u003e`__:\n\n.. code-block:: bash\n\n    python -m pip install oprf\n\nBy default, this library indirectly relies on `rbcl \u003chttps://pypi.org/project/rbcl\u003e`__ (which bundles a subset of the `libsodium \u003chttps://github.com/jedisct1/libsodium\u003e`__ library that is compiled for common architectures). However, it is possible to install a fully working pure-Python version of this library by installing only the pure-Python subset of the `oblivious \u003chttps://pypi.org/project/oblivious\u003e`__ dependency (*i.e.*, within an environment where `rbcl \u003chttps://pypi.org/project/rbcl\u003e`__ is not a required dependency of other installed packages). This approach makes it possible to use this library for rapid prototyping on exotic architectures (with the caveat that pure-Python implementations of primitives are much slower):\n\n.. code-block:: bash\n\n    python -m pip install oblivious~=7.0\n    python -m pip install oprf --no-dependencies\n\nThe library can be imported in the usual ways:\n\n.. code-block:: python\n\n    import oprf\n    from oprf import *\n\nExamples\n^^^^^^^^\nThis library makes it possible to concisely prepare binary or string data for masking:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from oprf import data, mask\n    \u003e\u003e\u003e d = data.hash('abc')\n\nA random mask can be constructed and applied to the data. A number of distinct notations is supported for masking in order to minimize differences between the notation within a protocol definition and its implementation:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e m = mask() # Create random mask.\n    \u003e\u003e\u003e m.mask(d) == m(d) == m * d\n    True\n    \u003e\u003e\u003e m(d) == d\n    False\n\nMask inversion and unmasking are also supported:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e c = m(d)\n    \u003e\u003e\u003e m.unmask(c) == (~m)(c) == c / m == d\n    True\n\nMasks can also be constructed deterministically from a bytes-like object or string:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e m = mask.hash('123')\n\n.. |data| replace:: ``data``\n.. _data: https://oprf.readthedocs.io/en/5.0.0/_source/oprf.html#oprf.oprf.data\n\n.. |mask| replace:: ``mask``\n.. _mask: https://oprf.readthedocs.io/en/5.0.0/_source/oprf.html#oprf.oprf.mask\n\n.. |bytes| replace:: ``bytes``\n.. _bytes: https://docs.python.org/3/library/stdtypes.html#bytes\n\nBecause the classes |data|_ and |mask|_ are derived from |bytes|_, `all methods and other operators \u003chttps://docs.python.org/3/library/stdtypes.html#bytes\u003e`__ supported by |bytes|_ objects are supported by |data|_ and |mask|_ objects:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e hex = 'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27a03'\n    \u003e\u003e\u003e m = mask.fromhex(hex)\n    \u003e\u003e\u003e m.hex()\n    'a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27a03'\n\nIn addition, Base64 conversion methods are included to support concise encoding and decoding of |data|_ and |mask|_ objects:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e d.from_base64(d.to_base64()) == d\n    True\n    \u003e\u003e\u003e m.from_base64(m.to_base64()) == m\n    True\n\nDevelopment\n-----------\nAll installation and development dependencies are fully specified in ``pyproject.toml``. The ``project.optional-dependencies`` object is used to `specify optional requirements \u003chttps://peps.python.org/pep-0621\u003e`__ for various development tasks. This makes it possible to specify additional options (such as ``docs``, ``lint``, and so on) when performing installation using `pip \u003chttps://pypi.org/project/pip\u003e`__:\n\n.. code-block:: bash\n\n    python -m pip install .[docs,lint]\n\nDocumentation\n^^^^^^^^^^^^^\nThe documentation can be generated automatically from the source files using `Sphinx \u003chttps://www.sphinx-doc.org\u003e`__:\n\n.. code-block:: bash\n\n    python -m pip install .[docs]\n    cd docs\n    sphinx-apidoc -f -E --templatedir=_templates -o _source .. \u0026\u0026 make html\n\nTesting and Conventions\n^^^^^^^^^^^^^^^^^^^^^^^\nAll unit tests are executed and their coverage is measured when using `pytest \u003chttps://docs.pytest.org\u003e`__ (see the ``pyproject.toml`` file for configuration details):\n\n.. code-block:: bash\n\n    python -m pip install .[test]\n    python -m pytest\n\nAlternatively, all unit tests are included in the module itself and can be executed using `doctest \u003chttps://docs.python.org/3/library/doctest.html\u003e`__:\n\n.. code-block:: bash\n\n    python src/oprf/oprf.py -v\n\nStyle conventions are enforced using `Pylint \u003chttps://pylint.readthedocs.io\u003e`__:\n\n.. code-block:: bash\n\n    python -m pip install .[lint]\n    python -m pylint src/oprf\n\nContributions\n^^^^^^^^^^^^^\nIn order to contribute to the source code, open an issue or submit a pull request on the `GitHub page \u003chttps://github.com/nthparty/oprf\u003e`__ for this library.\n\nVersioning\n^^^^^^^^^^\nThe version number format for this library and the changes to the library associated with version number increments conform with `Semantic Versioning 2.0.0 \u003chttps://semver.org/#semantic-versioning-200\u003e`__.\n\nPublishing\n^^^^^^^^^^\nThis library can be published as a `package on PyPI \u003chttps://pypi.org/project/oprf\u003e`__ by a package maintainer. First, install the dependencies required for packaging and publishing:\n\n.. code-block:: bash\n\n    python -m pip install .[publish]\n\nEnsure that the correct version number appears in ``pyproject.toml``, and that any links in this README document to the Read the Docs documentation of this package (or its dependencies) have appropriate version numbers. Also ensure that the Read the Docs project for this library has an `automation rule \u003chttps://docs.readthedocs.io/en/stable/automation-rules.html\u003e`__ that activates and sets as the default all tagged versions. Create and push a tag for this version (replacing ``?.?.?`` with the version number):\n\n.. code-block:: bash\n\n    git tag ?.?.?\n    git push origin ?.?.?\n\nRemove any old build/distribution files. Then, package the source into a distribution archive:\n\n.. code-block:: bash\n\n    rm -rf build dist src/*.egg-info\n    python -m build --sdist --wheel .\n\nFinally, upload the package distribution archive to `PyPI \u003chttps://pypi.org\u003e`__:\n\n.. code-block:: bash\n\n    python -m twine upload dist/*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnthparty%2Foprf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnthparty%2Foprf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnthparty%2Foprf/lists"}