{"id":18893387,"url":"https://github.com/xtaci/hppk","last_synced_at":"2025-04-15T00:31:43.533Z","repository":{"id":247721345,"uuid":"826195304","full_name":"xtaci/hppk","owner":"xtaci","description":"Homomorphic Polynomial Public Key","archived":false,"fork":false,"pushed_at":"2024-12-24T06:47:31.000Z","size":140,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T12:51:17.842Z","etag":null,"topics":["digital-signature","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-09T08:49:53.000Z","updated_at":"2024-12-24T06:47:35.000Z","dependencies_parsed_at":"2024-12-24T07:36:35.004Z","dependency_job_id":"fb11d518-75d7-4aff-8b84-5999d430da20","html_url":"https://github.com/xtaci/hppk","commit_stats":null,"previous_names":["xtaci/hppk"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fhppk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fhppk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fhppk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtaci%2Fhppk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtaci","download_url":"https://codeload.github.com/xtaci/hppk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248984325,"owners_count":21193727,"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":["digital-signature","key-encapsulation-mechanism","public-key-cryptography","quantum-resistant-cryptosystems"],"created_at":"2024-11-08T08:13:28.630Z","updated_at":"2025-04-15T00:31:43.214Z","avatar_url":"https://github.com/xtaci.png","language":"Go","readme":"## HPPK: Homomorphic Polynomial Public-key Cryptography\n\n\n[![GoDoc][1]][2] [![Go Report Card][3]][4] [![CreatedAt][5]][6] \n\n[1]: https://godoc.org/github.com/xtaci/hppk?status.svg\n[2]: https://pkg.go.dev/github.com/xtaci/hppk\n[3]: https://goreportcard.com/badge/github.com/xtaci/hppk\n[4]: https://goreportcard.com/report/github.com/xtaci/hppk\n[5]: https://img.shields.io/github/created-at/xtaci/hppk\n[6]: https://img.shields.io/github/created-at/xtaci/hppk\n\n## Overview\n\nHPPK is an implementation of a Homomorphic Polynomial Public Key (HPPK) system, designed for both Key Encapsulation Mechanisms (KEM) and Digital Signatures (DS). This cryptographic protocol leverages the properties of polynomials to create secure, efficient methods for key exchange and message signing.\n\nThe main objectives of HPPK are to provide:\n\n- **Secure key encapsulation**: Facilitating the secure exchange of symmetric keys.\n- **Robust digital signatures**: Ensuring the authenticity and integrity of messages.\n\nFor a detailed explanation of the underlying theory and security proofs, please refer to the [research paper](https://arxiv.org/pdf/2402.01852).\n\n## Features\n\n- **Homomorphic Encryption**: Allows computations on ciphertexts that result in encrypted outcomes, which match the operations performed on the plaintexts.\n- **Polynomial-Based Cryptography**: Utilizes polynomials to create robust public and private keys.\n- **Efficient Key Encapsulation Mechanism (KEM)**: Securely exchanges symmetric keys.\n- **Strong Digital Signatures (DS)**: Provides authentication and integrity verification of messages.\n- **Scalable and Efficient**: Suitable for various applications, ranging from small-scale systems to large, complex networks.\n  \n![348681154-37b88d3c-9bd6-4436-9837-1a0b078e5ac1](https://github.com/user-attachments/assets/8bd6fd28-b7be-4c0e-b417-7ab5e95b13bc)\n\n\n## Installation\n```console\n$ go install github.com/xtaci/hppk/cmd/hppktool\n$ hppktool\nHPPK key management tool.\nSupports key generation, signing, verification, and secret encryption.\n\nUsage:\n  hppktool [command]\n\nAvailable Commands:\n  completion  Generate the autocompletion script for the specified shell\n  encrypt     Encrypts a message from standard input\n  help        Help about any command\n  keygen      Generate an HPPK private/public key pair\n  sign        Sign a message from standard input\n  verify      Verify a message from standard input\n\nFlags:\n  -h, --help     help for hppktool\n  -s, --silent   Suppress non-essential messages\n\nUse \"hppktool [command] --help\" for more information about a command.\n```\n## Using Library\n\nTo use HPPK, you need to have Go installed. You can download and install Go from [the official website](https://golang.org/dl/).\n\n1. Clone the repository:\n\n    ```console\n    git clone https://github.com/xtaci/hppk.git\n    cd hppk\n    ```\n\n2. Build the project:\n\n    ```console\n    go build\n    ```\n\n## Usage\n\n### Generating Keys\n\nTo generate a new pair of private and public keys:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/xtaci/hppk\"\n)\n\nfunc main() {\n    privateKey, err := hppk.GenerateKey(5)\n    if err != nil {\n        fmt.Println(\"Error generating keys:\", err)\n        return\n    }\n    fmt.Println(\"Private Key:\", privateKey)\n    fmt.Println(\"Public Key:\", privateKey.PublicKey)\n}\n```\n\n### Encryption\n\nTo encrypt a message using the public key:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/xtaci/hppk\"\n)\n\nfunc main() {\n    privKey, err := hppk.GenerateKey(10)\n    if err != nil {\n        panic(err)\n    }\n    pubKey := privKey.Public()\n\n    message := []byte(\"hello world\")\n    kem, err := hppk.Encrypt(pubKey, message)\n    if err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"Encrypted KEM: %+v\\n\", kem)\n}\n```\n\n### Decryption\n\nTo decrypt the encrypted values using the private key:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/xtaci/hppk\"\n)\n\nfunc main() {\n    privKey, err := hppk.GenerateKey(10)\n    if err != nil {\n        panic(err)\n    }\n    pubKey := privKey.Public()\n\n    message := []byte(\"hello world\")\n    kem, err := hppk.Encrypt(pubKey, message)\n    if err != nil {\n        panic(err)\n    }\n\n    decryptedMessage, err := privKey.Decrypt(kem)\n    if err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"Decrypted Message: %s\\n\", decryptedMessage)\n}\n```\n\n### Signing\n```go\npackage main\n\nimport (\n    \"crypto/sha256\"\n    \"fmt\"\n    \"github.com/xtaci/hppk\"\n)\n\nfunc main() {\n    privKey, err := hppk.GenerateKey(10)\n    if err != nil {\n        panic(err)\n    }\n\n    digest := sha256.Sum256([]byte(\"hello world\"))\n    signature, err := privKey.Sign(digest[:])\n    if err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"Signature: %+v\\n\", signature)\n}\n\n```\n\n### Verification\n```go\npackage main\n\nimport (\n    \"crypto/sha256\"\n    \"fmt\"\n    \"github.com/xtaci/hppk\"\n)\n\nfunc main() {\n    privKey, err := hppk.GenerateKey(10)\n    if err != nil {\n        panic(err)\n    }\n    pubKey := privKey.Public()\n\n    digest := sha256.Sum256([]byte(\"hello world\"))\n    signature, err := privKey.Sign(digest[:])\n    if err != nil {\n        panic(err)\n    }\n\n    isValid := hppk.VerifySignature(signature, digest[:], pubKey)\n    fmt.Printf(\"Signature valid: %v\\n\", isValid)\n}\n\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* QPP and HPPK: Unifying Non-Commutativity for Quantum-Secure Cryptography with Galois Permutation Group (https://arxiv.org/pdf/2402.01852).\n* Homomorphic Polynomial Public Key Cryptography for Quantum-secure Digital Signature (https://www.academia.edu/123150574/Homomorphic_Polynomial_Public_Key_Cryptography_for_Quantum_secure_Digital_Signature?email_work_card=view-paper)\n\n## Acknowledgments\n\nSpecial thanks to the authors of the research paper for their groundbreaking work on HPPK and its applications in KEM and DS.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtaci%2Fhppk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtaci%2Fhppk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtaci%2Fhppk/lists"}