{"id":19000207,"url":"https://github.com/tonyo/pyope","last_synced_at":"2026-03-17T21:36:48.505Z","repository":{"id":25202911,"uuid":"28626716","full_name":"tonyo/pyope","owner":"tonyo","description":"Implementation of Boldyreva's symmetric order-preserving encryption in Python","archived":false,"fork":false,"pushed_at":"2022-12-07T22:19:37.000Z","size":56,"stargazers_count":102,"open_issues_count":2,"forks_count":19,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-12-20T18:05:10.366Z","etag":null,"topics":["cryptography","encryption","python"],"latest_commit_sha":null,"homepage":"","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/tonyo.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["tonyo"]}},"created_at":"2014-12-30T10:26:01.000Z","updated_at":"2025-10-17T13:42:40.000Z","dependencies_parsed_at":"2023-01-14T02:18:53.172Z","dependency_job_id":null,"html_url":"https://github.com/tonyo/pyope","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/tonyo/pyope","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyo%2Fpyope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyo%2Fpyope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyo%2Fpyope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyo%2Fpyope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tonyo","download_url":"https://codeload.github.com/tonyo/pyope/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonyo%2Fpyope/sbom","scorecard":{"id":894037,"data":{"date":"2025-08-11","repo":{"name":"github.com/tonyo/pyope","commit":"aad20461ecf6ff3803b1007f1d2e6ec8839d7b69"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/24 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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-tests.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":"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":"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/python-tests.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/tonyo/pyope/python-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-tests.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/tonyo/pyope/python-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-tests.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/tonyo/pyope/python-tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-tests.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/tonyo/pyope/python-tests.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-tests.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/python-tests.yml:32","Warn: pipCommand not pinned by hash: .github/workflows/python-tests.yml:33","Warn: pipCommand not pinned by hash: .github/workflows/python-tests.yml:34","Warn: pipCommand not pinned by hash: .github/workflows/python-tests.yml:55","Warn: pipCommand not pinned by hash: .github/workflows/python-tests.yml:56","Warn: pipCommand not pinned by hash: .github/workflows/python-tests.yml:57","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   7 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":"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 'master'"],"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T12:58:58.703Z","repository_id":25202911,"created_at":"2025-08-24T12:58:58.703Z","updated_at":"2025-08-24T12:58:58.703Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30632064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"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":["cryptography","encryption","python"],"created_at":"2024-11-08T18:06:32.778Z","updated_at":"2026-03-17T21:36:48.479Z","avatar_url":"https://github.com/tonyo.png","language":"Python","funding_links":["https://github.com/sponsors/tonyo"],"categories":["Python"],"sub_categories":[],"readme":"pyope\n=====\n\n|PyPi version| |Travis build|\n\nThis is an implementation of Boldyreva symmetric `order-preserving encryption`_ scheme (`Boldyreva's paper`_).\n\nSupported Python versions: 2.7 and 3.5+\n\n**Disclaimer 1** This is an experimental implementation, which should be thoroughly reviewed and evaluated before using in production and/or sensitive applications.\n\n**Disclaimer 2** The Boldyreva scheme is not a standardized algorithm, so there are no test vectors and fixed plaintext-ciphertext\nmapping for a given key. It means that, generally speaking, a plaintext encrypted with the same key by two different versions of the package might not be equal to each other.\n\nInstallation\n------------\n\n.. code:: shell\n\n  pip install pyope\n\nExamples\n--------------\n\nQuick start\n\n.. code:: python\n\n  from pyope.ope import OPE\n  random_key = OPE.generate_key()\n  cipher = OPE(random_key)\n  assert cipher.encrypt(1000) \u003c cipher.encrypt(2000) \u003c cipher.encrypt(3000)\n  assert cipher.decrypt(cipher.encrypt(1337)) == 1337\n\n\nYou can specify input and output ranges. Otherwise, default input (0..2^15-1) and output (0..2^31-1) ranges are used.\n\n.. code:: python\n\n  from pyope.ope import OPE, ValueRange\n  cipher = OPE(b'long key' * 2, in_range=ValueRange(-100, 100),\n                                out_range=ValueRange(0, 9999))\n  assert 0 \u003c cipher.encrypt(10) \u003c cipher.encrypt(42) \u003c 9999\n\n\nAbout order-preserving encryption\n---------------------------------\n\nOrder-preserving encryption (OPE) allows to compare ciphertext values in order to learn the corresponding relation\nbetween the underlying plaintexts. By definition, order-preserving encryption methods are **less secure** than\nconventional encryption algorithms for the same data sizes, because the former leak ordering information of the plaintext \nvalues.\n\nHow can OPE be useful? For example, some systems may need OPE to perform a certain set of queries (such as range SQL\nqueries) over encrypted data. These systems include `CryptDB`_ and `Monomi`_ to name a few.\n\nSecurity\n--------\n\nAs mentioned above, security guarantees for Boldyreva's schema are weaker than those of deterministic encryption schemes,\nbut security can still be improved if the encryption keys are long enough. It is advised to use randomly generated keys at\nleast 256 bits long.\n\n\nRunning tests\n-------------\n\nPyTest is used as a test framework. Run all tests:\n\n::\n\n$ py.test tests/\n\nTODO\n----\n\n- More tests\n- Optimize performance\n- Security guarantees?\n\n.. |PyPi version| image:: https://img.shields.io/pypi/v/pyope.svg\n   :target: https://pypi.python.org/pypi/pyope/\n.. |Travis build| image:: https://travis-ci.org/tonyo/pyope.svg?branch=master\n   :target: https://travis-ci.org/tonyo/pyope/\n.. _order-preserving encryption: https://crypto.stackexchange.com/questions/3813/how-does-order-preserving-encryption-work\n.. _Boldyreva's paper: http://www.cc.gatech.edu/~aboldyre/papers/bclo.pdf\n.. _CryptDB: http://css.csail.mit.edu/cryptdb/\n.. _Monomi: http://people.csail.mit.edu/nickolai/papers/tu-monomi.pdf\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonyo%2Fpyope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftonyo%2Fpyope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonyo%2Fpyope/lists"}