{"id":28520765,"url":"https://github.com/wolframalph/dh","last_synced_at":"2025-07-02T19:32:36.489Z","repository":{"id":57662106,"uuid":"477806011","full_name":"WolframAlph/dh","owner":"WolframAlph","description":"Diffie-Hellman key exchange implementation in Go","archived":false,"fork":false,"pushed_at":"2022-04-04T21:15:42.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T03:54:29.799Z","etag":null,"topics":["cryptography","diffie-hellman","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WolframAlph.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":"2022-04-04T17:33:12.000Z","updated_at":"2023-02-24T07:48:24.000Z","dependencies_parsed_at":"2022-09-12T23:21:08.706Z","dependency_job_id":null,"html_url":"https://github.com/WolframAlph/dh","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/WolframAlph/dh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframAlph%2Fdh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframAlph%2Fdh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframAlph%2Fdh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframAlph%2Fdh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WolframAlph","download_url":"https://codeload.github.com/WolframAlph/dh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframAlph%2Fdh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263203417,"owners_count":23430025,"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":["cryptography","diffie-hellman","golang"],"created_at":"2025-06-09T07:08:09.785Z","updated_at":"2025-07-02T19:32:36.479Z","avatar_url":"https://github.com/WolframAlph.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dh\n\ndh is a simple, ready to use Diffie-Hellman-Ephemeral implementation written in golang \nusing MODP groups as defined in [RFC3526](https://datatracker.ietf.org/doc/html/rfc3526).\n\nExample:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"github.com/WolframAlph/dh\"\n)\n    \nfunc main() {\n\talice := dh.New()\n\tbob := dh.New()\n\t\n\taliceSecret := alice.ComputeSecret(bob.PublicKey)\n\tbobSecret := bob.ComputeSecret(alice.PublicKey)\n\t\n\tfmt.Println(reflect.DeepEqual(aliceSecret, bobSecret)) // true\n}\n```\n\n## Notes\n\nYou must use the same MODP group on both sides, or else you\nend up with non-matching keys. Group #14 is used by default. You\ncan use different group from available (5, 14, 15, 16, 17, 18).\nExample using other group:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"github.com/WolframAlph/dh\"\n)\n    \nfunc main() {\n\tmodpGroup := 16\n\talice := dh.New(modpGroup)\n\tbob := dh.New(modpGroup)\n\t\n\taliceSecret := alice.ComputeSecret(bob.PublicKey)\n\tbobSecret := bob.ComputeSecret(alice.PublicKey)\n\t\n\tfmt.Println(reflect.DeepEqual(aliceSecret, bobSecret)) // true\n}\n```\n\nExample using different groups:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\t\"github.com/WolframAlph/dh\"\n)\n    \nfunc main() {\n\talice := dh.New(15)\n\tbob := dh.New(18)\n\t\n\taliceSecret := alice.ComputeSecret(bob.PublicKey)\n\tbobSecret := bob.ComputeSecret(alice.PublicKey)\n\t\n\tfmt.Println(reflect.DeepEqual(aliceSecret, bobSecret)) // false\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolframalph%2Fdh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolframalph%2Fdh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolframalph%2Fdh/lists"}