{"id":28421142,"url":"https://github.com/latchset/python-rubenesque","last_synced_at":"2025-07-11T18:02:51.520Z","repository":{"id":46343146,"uuid":"44774192","full_name":"latchset/python-rubenesque","owner":"latchset","description":"Pure Python implementation of standard elliptic curves","archived":false,"fork":false,"pushed_at":"2021-10-29T22:03:34.000Z","size":54,"stargazers_count":17,"open_issues_count":2,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T04:36:40.193Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/latchset.png","metadata":{"files":{"readme":"README.md","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":"2015-10-22T21:25:57.000Z","updated_at":"2022-03-28T03:08:11.000Z","dependencies_parsed_at":"2022-09-22T22:50:34.875Z","dependency_job_id":null,"html_url":"https://github.com/latchset/python-rubenesque","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/latchset/python-rubenesque","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/latchset%2Fpython-rubenesque","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/latchset%2Fpython-rubenesque/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/latchset%2Fpython-rubenesque/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/latchset%2Fpython-rubenesque/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/latchset","download_url":"https://codeload.github.com/latchset/python-rubenesque/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/latchset%2Fpython-rubenesque/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264868300,"owners_count":23676091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-06-05T04:46:28.314Z","updated_at":"2025-07-11T18:02:51.508Z","avatar_url":"https://github.com/latchset.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Rubenesque\n==========\n\nRubenesque is an implementation of several standard elliptic curve groups\nin pure Python 3 used for cryptographic purposes. The classes contained in\nthis source code should be sufficient to implement your own cryptographic\nprimitives.\n\nHowever, please note that, due to the nature of the Python programming\nlanguage, this code cannot guarantee either performance or safety from\nside-channel attacks. Using this library in situations where such properties\nare required is not advised and may actively lead to security compromise.\nAlthough this project will accept patches to improve performance, we will\nnot consider performance or side-channel avoidance as valid bugs.\n\nRubenesque does, however, strive to be correct and standards compliant. This\nmakes it useful in a variety of scenarios; especially use cases such as\noffline cryptography or unit tests against servers programmed in lower level\nlanguages.\n\nRubenesque currently implements the following curves:\n\n * brainpoolP160r1\n * brainpoolP192r1\n * brainpoolP224r1\n * brainpoolP256r1\n * brainpoolP320r1\n * brainpoolP384r1\n * brainpoolP512r1\n * edwards25519\n * edwards448\n * MDC201601\n * secp192r1\n * secp224r1\n * secp256r1\n * secp384r1\n * secp521r1\n\nHere is a simple example of doing ECDH with SEC P256 using SEC1 encoding.\n\nBoth sides prepare for the exchange by loading the same curve and encoding:\n```\n\u003e\u003e\u003e from rubenesque.codecs.sec import encode, decode\n\u003e\u003e\u003e import rubenesque.curves\n\u003e\u003e\u003e secp256r1 = rubenesque.curves.find('secp256r1')\n```\n\nAlice generates her private and public keys:\n```\n\u003e\u003e\u003e alice_prv = secp256r1.private_key()\n\u003e\u003e\u003e alice_pub = secp256r1.generator() * alice_prv\n\u003e\u003e\u003e alice_enc = encode(alice_pub)\n```\n\nBob does the same:\n```\n\u003e\u003e\u003e bob_prv = secp256r1.private_key()\n\u003e\u003e\u003e bob_pub = secp256r1.generator() * bob_prv\n\u003e\u003e\u003e bob_enc = encode(bob_pub)\n```\nAfter exchanging their encoded keys, Alice computes the session key:\n```\n\u003e\u003e\u003e alice_ses = decode(secp256r1, bob_enc) * alice_prv\n```\n\nBob does the same:\n```\n\u003e\u003e\u003e bob_ses = decode(secp256r1, alice_enc) * bob_prv\n```\n\nNotice that Bob and Alice share the same session key, but not private key:\n```\n\u003e\u003e\u003e alice_prv == bob_prv\nFalse\n\u003e\u003e\u003e alice_ses == bob_ses\nTrue\n```\n\n\nLicense\n========\nRubenesque is licensed under the BSD 2-Clause license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flatchset%2Fpython-rubenesque","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flatchset%2Fpython-rubenesque","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flatchset%2Fpython-rubenesque/lists"}