{"id":18893390,"url":"https://github.com/xtaci/dppk","last_synced_at":"2025-04-15T00:31:43.664Z","repository":{"id":247095567,"uuid":"824463589","full_name":"xtaci/dppk","owner":"xtaci","description":"A Deterministic Polynomial Public Key Algorithm over a Prime  Galois Field GF(p) ","archived":false,"fork":false,"pushed_at":"2024-09-29T06:52:52.000Z","size":79,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T12:51:15.395Z","etag":null,"topics":["galois-unsolvable-polynomials","key-encapsulation-mechanism","public-key-cryptography","quantum-resistant-cryptosystems"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xtaci.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-05T07:31:55.000Z","updated_at":"2024-09-29T06:52:55.000Z","dependencies_parsed_at":"2024-08-05T07:54:54.833Z","dependency_job_id":null,"html_url":"https://github.com/xtaci/dppk","commit_stats":null,"previous_names":["xtaci/dppk"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fdppk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fdppk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fdppk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fdppk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtaci","download_url":"https://codeload.github.com/xtaci/dppk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248984324,"owners_count":21193726,"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":["galois-unsolvable-polynomials","key-encapsulation-mechanism","public-key-cryptography","quantum-resistant-cryptosystems"],"created_at":"2024-11-08T08:13:29.116Z","updated_at":"2025-04-15T00:31:43.371Z","avatar_url":"https://github.com/xtaci.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc][1]][2] [![Go Report Card][3]][4] [![CreatedAt][5]][6] \n\n[1]: https://godoc.org/github.com/xtaci/dppk?status.svg\n[2]: https://pkg.go.dev/github.com/xtaci/dppk\n[3]: https://goreportcard.com/badge/github.com/xtaci/dppk\n[4]: https://goreportcard.com/report/github.com/xtaci/dppk\n[5]: https://img.shields.io/github/created-at/xtaci/dppk\n[6]: https://img.shields.io/github/created-at/xtaci/dppk\n\n\n[A Deterministic Polynomial Public Key Algorithm over a Prime Galois Field GF(p)](https://www.researchgate.net/profile/Randy-Kuang/publication/358101087_A_Deterministic_Polynomial_Public_Key_Algorithm_over_a_Prime_Galois_Field_GFp/links/61f95ff44393577abe055af7/A-Deterministic-Polynomial-Public-Key-Algorithm-over-a-Prime-Galois-Field-GFp.pdf)\n\nDPPK is an [Key encapsulation mechanism](https://en.wikipedia.org/wiki/Key_encapsulation_mechanism), a.k.a. - KEM\n\n## Overview\n\nThe ancient [Vieta’s formulas](https://en.wikipedia.org/wiki/Vieta%27s_formulas) reveal the relationships between the coefficients of an nth-degree polynomial and its roots. It has been surprisingly found that there exists a hidden secret for a potential public key exchange: decoupling the product of all roots (or the constant term) from the summations of root products (or coefficients) of a polynomial to establish a keypair.\n\n# Deterministic Polynomial Public Key (DPPK)\n\n## Key Principles\n\n1. **Factorization Dependency**: The DPPK algorithm is built on the fact that a polynomial cannot be factorized without its constant term.\n2. **Keypair Construction**: The keypair generator combines a base polynomial, which can be eliminated during decryption, with two solvable polynomials to create two entangled polynomials.\n   - **Public Key**: Formed by the coefficient vectors of the entangled polynomials.\n   - **Private Key**: Composed of the constant terms of the entangled polynomials and the two solvable polynomials.\n\n## Security Mechanism\n\n- By only publishing the coefficients of the polynomials without their constant terms, polynomial factoring techniques for private key extraction are greatly restricted.\n- The time complexity for private key extraction from the public key is:\n  - **Classical Attacks**: Super-exponential difficulty $O(p^2)$.\n  - **Quantum Attacks**: Exponential difficulty $O(p)$.\n- In comparison, the complexity for the Polynomial Factoring Problem (PFP) is:\n  - **Classical Attacks**: $O(n\\sqrt{p})$.\n  - **Quantum Attacks**: $O(\\sqrt{p})$, matching the complexity level of Grover’s search algorithm.\n\n## Keypair Generation and Encryption/Decryption\n\n- The central idea for keypair construction arises from Vieta’s formulas by decoupling the coefficients of a polynomial into two categories:\n  - **Private**: From its constant term.\n  - **Public**: From the coefficients of the indeterminate $x$.\n\n- DPPK uses two entangled generic polynomials based on a common base polynomial $B_n(x)$ with two solvable polynomials $u(x)$ and $v(x)$:\n  - **Public Key**: All coefficients of the entangled polynomials.\n  - **Private Key**: Their constant terms and the two solvable polynomials.\n\n## Security Analysis\n\n- **Deterministic Time Complexity**:\n  - **Classical Attacks**: $O(\\sqrt{p})$ (super-exponential difficulty).\n  - **Quantum Attacks**: $O(p)$ (exponential difficulty).\n  \n## Installation\nTo install DPPK, use:\n```console\ngo get -u github.com/xtaci/dppk\n```\n\n## Examples\n#### Keypair Generation\n```go\npackage main\n\nimport (\n    \"github.com/xtaci/dppk\"\n    \"log\"\n)\n\nfunc main() {\n    // Generate key for Alice\n    alice, err := dppk.GenerateKey(10)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Generate key for Bob\n    bob, err := dppk.GenerateKey(10)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    log.Println(\"Alice's Public Key:\", alice.PublicKey)\n    log.Println(\"Bob's Public Key:\", bob.PublicKey)\n}\n\n```\n\n#### Encryption\n```go\npackage main\n\nimport (\n    \"github.com/xtaci/dppk\"\n    \"log\"\n    \"math/big\"\n)\n\nfunc main() {\n    // Assume alice and bob have already generated their keys\n    alice, _ := dppk.GenerateKey(10)\n    bob, _ := dppk.GenerateKey(10)\n\n    // Secret message\n    secret := new(big.Int).SetBytes([]byte(\"hello quantum\"))\n\n    // Bob encrypts the message for Alice\n    kem, err := bob.Encrypt(\u0026alice.PublicKey, secret)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    log.Printf(\"KEM: %+v\\n\", kem)\n}\n\n```\n\n#### Decryption\n```go\npackage main\n\nimport (\n    \"github.com/xtaci/dppk\"\n    \"log\"\n)\n\nfunc main() {\n    // Assume alice and bob have already generated their keys and bob has encrypted a message\n    alice, _ := dppk.GenerateKey(10)\n    bob, _ := dppk.GenerateKey(10)\n    secret := new(big.Int).SetBytes([]byte(\"hello quantum\"))\n    kem, _ := bob.Encrypt(\u0026alice.PublicKey, secret)\n\n    // Alice decrypts the message\n    x1, x2, err := alice.Decrypt(kem)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    log.Println(\"Decrypted message x1:\", x1)\n    log.Println(\"Decrypted message x2:\", x2)\n}\n```\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any improvements, bug fixes, or additional features.\n\n## License\n\nThis project is licensed under the GPLv3 License. See the [LICENSE](LICENSE) file for details.\n\n## References\n\nFor more detailed information, please refer to the [research paper](https://www.researchgate.net/profile/Randy-Kuang/publication/358101087_A_Deterministic_Polynomial_Public_Key_Algorithm_over_a_Prime_Galois_Field_GFp/links/61f95ff44393577abe055af7/A-Deterministic-Polynomial-Public-Key-Algorithm-over-a-Prime-Galois-Field-GFp.pdf).\n\n## Acknowledgments\n\nSpecial thanks to the authors of the research paper for their groundbreaking work on DPPK.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtaci%2Fdppk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtaci%2Fdppk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtaci%2Fdppk/lists"}