{"id":27026873,"url":"https://github.com/serengil/lightdsa","last_synced_at":"2025-09-06T16:35:02.250Z","repository":{"id":282737238,"uuid":"948179460","full_name":"serengil/LightDSA","owner":"serengil","description":"A Lightweight Digital Signature Algorithm Library for Python","archived":false,"fork":false,"pushed_at":"2025-07-09T12:42:34.000Z","size":160,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-02T11:47:00.016Z","etag":null,"topics":["digital-signature","dsa","ecdsa","eddsa","edwards-curve-digital-signature-algorithm","elliptic-curve-cryptography","elliptic-curve-digital-signature-algorithm","rsa"],"latest_commit_sha":null,"homepage":"https://www.youtube.com/watch?v=-a3CwbPopao\u0026list=PLsS_1RYmYQQFgdwq4lCwagnzEGkB9P5Sa\u0026index=1","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/serengil.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"serengil","patreon":"serengil","buy_me_a_coffee":"serengil"}},"created_at":"2025-03-13T22:08:44.000Z","updated_at":"2025-07-09T12:42:38.000Z","dependencies_parsed_at":"2025-03-16T17:15:31.703Z","dependency_job_id":"6b416de0-350a-4a4d-81e5-2059482d6465","html_url":"https://github.com/serengil/LightDSA","commit_stats":null,"previous_names":["serengil/lightdsa"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/serengil/LightDSA","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2FLightDSA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2FLightDSA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2FLightDSA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2FLightDSA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serengil","download_url":"https://codeload.github.com/serengil/LightDSA/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serengil%2FLightDSA/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273932764,"owners_count":25193599,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["digital-signature","dsa","ecdsa","eddsa","edwards-curve-digital-signature-algorithm","elliptic-curve-cryptography","elliptic-curve-digital-signature-algorithm","rsa"],"created_at":"2025-04-04T23:16:14.830Z","updated_at":"2025-09-06T16:35:02.242Z","avatar_url":"https://github.com/serengil.png","language":"Python","funding_links":["https://github.com/sponsors/serengil","https://patreon.com/serengil","https://buymeacoffee.com/serengil","https://www.patreon.com/serengil?repo=lightdsa"],"categories":[],"sub_categories":[],"readme":"# LightDSA\n\n\u003cdiv align=\"center\"\u003e\n\n[![PyPI Downloads](https://static.pepy.tech/personalized-badge/lightdsa?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=blue\u0026left_text=downloads)](https://pepy.tech/project/lightdsa)\n[![Stars](https://img.shields.io/github/stars/serengil/LightDSA?color=yellow\u0026style=flat\u0026label=%E2%AD%90%20stars)](https://github.com/serengil/LightDSA/stargazers)\n[![Tests](https://github.com/serengil/LightDSA/actions/workflows/tests.yml/badge.svg)](https://github.com/serengil/LightDSA/actions/workflows/tests.yml)\n[![License](http://img.shields.io/:license-MIT-green.svg?style=flat)](https://github.com/serengil/LightPHE/blob/master/LICENSE)\n[![arXiv](https://img.shields.io/badge/arXiv-2505.23773-b31b1b.svg?logo=arXiv)](https://arxiv.org/abs/2505.23773)\n\n[![Blog](https://img.shields.io/:blog-sefiks.com-blue.svg?style=flat\u0026logo=wordpress)](https://sefiks.com)\n[![YouTube](https://img.shields.io/:youtube-@sefiks-red.svg?style=flat\u0026logo=youtube)](https://www.youtube.com/@sefiks?sub_confirmation=1)\n[![Twitter](https://img.shields.io/:follow-@serengil-blue.svg?style=flat\u0026logo=x)](https://twitter.com/intent/user?screen_name=serengil)\n\n[![Patreon](https://img.shields.io/:become-patron-f96854.svg?style=flat\u0026logo=patreon)](https://www.patreon.com/serengil?repo=lightdsa)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/serengil?logo=GitHub\u0026color=lightgray)](https://github.com/sponsors/serengil)\n[![Buy Me a Coffee](https://img.shields.io/badge/-buy_me_a%C2%A0coffee-gray?logo=buy-me-a-coffee)](https://buymeacoffee.com/serengil)\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/serengil/LightDSA/master/images/shield.png\" width=\"250\" height=\"250\"\u003e\u003c/p\u003e\n\nLightDSA is a lightweight digital signature algorithm library for Python. It is a hybrid library supporting [Elliptic Curve Digital Signature Algorithm (ECDSA)](https://sefiks.com/2018/02/16/elegant-signatures-with-elliptic-curve-cryptography/) and [Edwards-Curve Digital Signature Algorithm (EdDSA)](https://sefiks.com/2018/12/24/a-gentle-introduction-to-edwards-curve-digital-signature-algorithm-eddsa/), [RSA](https://sefiks.com/2023/03/06/a-step-by-step-partially-homomorphic-encryption-example-with-rsa-in-python/) and [DSA](https://sefiks.com/2023/06/14/digital-signature-algorithm-dsa-in-python-from-scratch/).\n\n# Installation [![PyPI](https://img.shields.io/pypi/v/lightdsa.svg)](https://pypi.org/project/lightdsa/)\n\nThe easiest way to install the LightDSA package is to install it from python package index (PyPI).\n\n```shell\npip install lightdsa\n```\n\nThen you will be able to import the library and use its functionalities.\n\n```python\nfrom lightdsa import LightDSA\n```\n\n# Usage\n\nOnce you initialize a LightDSA object with a specific DSA algorithm, such as ECDSA, EdDSA, or RSA, it will generate the private and public keys for your cryptosystem.\n\n```python\n# built a cryptosystem\ndsa = LightDSA(algorithm_name = \"eddsa\") # or ecdsa, rsa\n\n# export keys\ndsa.export_keys(\"public.txt\", public = True)\n\n# sign a message\nmessage = \"Hello, world!\"\nsignature = dsa.sign(message)\n```\n\nIf you wish to use a pre-existing exported cryptosystem, you should specify the exported key file during initialization. This will allow you to sign messages using the private key and verify messages using the public key as\n\n```python\n# restore the cryptosystem for the verifier side\nverifier_dsa = LightDSA(algorithm_name = \"eddsa\", key_file = \"public.txt\")\nverifier_dsa.verify(message, signature)\n```\n\n# Elliptic Curve Forms and Pre-Defined Curves\n\nLightDSA supports [Weierstrass](https://sefiks.com/2016/03/13/the-math-behind-elliptic-curve-cryptography/), [Koblitz](https://sefiks.com/2016/03/13/the-math-behind-elliptic-curves-over-binary-field/) and [Edwards](https://sefiks.com/2018/12/19/a-gentle-introduction-to-edwards-curves/) forms and hundreds of pre-defined curves that can be adopted in ECDSA and EdDSA.\n\nBy default, ECDSA uses the Weierstrass form with the secp256k1 curve (the curve used by Bitcoin), while EdDSA uses the Edwards form with the ed25519 curve. However, you can switch the elliptic curve form and the specific curve for both ECDSA and EdDSA during the initialization of the LightDSA object. Meanwhile, the hashing algorithm is determined based on [the order of the elliptic curve](https://sefiks.com/2018/02/27/counting-points-on-elliptic-curves-over-finite-field/), which defines the number of points available over the finite field.\n\n```python\ndsa = LightDSA(\n    algorithm_name = \"eddsa\",\n    form_name = \"edwards\",\n    curve_name = \"ed448\"\n)\n```\n\nSee [`curves`](https://github.com/serengil/LightECC#supported-curves) page for more details.\n\n# Contributing\n\nAll PRs are more than welcome! If you are planning to contribute a large patch, please create an issue first to get any upfront questions or design decisions out of the way first.\n\nYou should be able run `make test` and `make lint` commands successfully before committing. Once a PR is created, GitHub test workflow will be run automatically and unit test results will be available in [GitHub actions](https://github.com/serengil/LightDSA/actions/workflows/tests.yml) before approval.\n\n# Support\n\nThere are many ways to support a project - starring⭐️ the GitHub repo is just one 🙏\n\nYou can also support this work on [Patreon](https://www.patreon.com/serengil?repo=lightdsa), [GitHub Sponsors](https://github.com/sponsors/serengil) or [Buy Me a Coffee](https://buymeacoffee.com/serengil).\n\n\u003ca href=\"https://www.patreon.com/serengil?repo=lightdsa\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/serengil/LightPHE/master/icons/patreon.png\" width=\"30%\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://buymeacoffee.com/serengil\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/serengil/LightPHE/master/icons/bmc-button.png\" width=\"25%\"\u003e\n\u003c/a\u003e\n\nAlso, your company's logo will be shown on README on GitHub if you become sponsor in gold, silver or bronze tiers.\n\n# Citation\n\nPlease cite LightDSA in your publications if it helps your research. Here is its BibTex entry:\n\n```BibTeX\n@article{serengil2025lightdsa,\n  title={LightDSA: A Python-Based Hybrid Digital Signature Library and Performance Analysis of RSA, DSA, ECDSA and EdDSA in Variable Configurations, Elliptic Curve Forms and Curves},\n  author={Serengil, Sefik and Ozpinar, Alper},\n  journal={arXiv preprint arXiv:2505.23773},\n  note={doi: 10.48550/arXiv.2505.23773. [Online]. Available: \\url{https://arxiv.org/abs/2505.23773}},\n  year={2025}\n}\n```\n\n# License\n\nLightDSA is licensed under the MIT License - see [`LICENSE`](https://github.com/serengil/LightDSA/blob/master/LICENSE) for more details.\n\nLightDSA [logo](https://thenounproject.com/icon/captain-america-shield-2579667/) is created by [M. Ristiyanto](https://thenounproject.com/creator/masmajnun.studio/) and it is licensed under [Creative Commons: By Attribution 3.0 License](https://creativecommons.org/licenses/by/3.0/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserengil%2Flightdsa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserengil%2Flightdsa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserengil%2Flightdsa/lists"}