{"id":26155549,"url":"https://github.com/ntdls/ntdls.securekeyexchange","last_synced_at":"2025-04-14T07:42:50.926Z","repository":{"id":63432824,"uuid":"130256858","full_name":"NTDLS/NTDLS.SecureKeyExchange","owner":"NTDLS","description":"Easily generate a single or multi-round Diffie-Hellman key.","archived":false,"fork":false,"pushed_at":"2024-12-31T12:11:30.000Z","size":176,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T10:17:22.592Z","etag":null,"topics":["cryptography","diffie-hellman","key-exchange","key-exchange-algorithms","random-key-generator","secure"],"latest_commit_sha":null,"homepage":"","language":"C++","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/NTDLS.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":"2018-04-19T18:32:07.000Z","updated_at":"2024-12-31T12:11:23.000Z","dependencies_parsed_at":"2024-02-22T21:53:58.546Z","dependency_job_id":null,"html_url":"https://github.com/NTDLS/NTDLS.SecureKeyExchange","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTDLS%2FNTDLS.SecureKeyExchange","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTDLS%2FNTDLS.SecureKeyExchange/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTDLS%2FNTDLS.SecureKeyExchange/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTDLS%2FNTDLS.SecureKeyExchange/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NTDLS","download_url":"https://codeload.github.com/NTDLS/NTDLS.SecureKeyExchange/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248842532,"owners_count":21170380,"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","key-exchange","key-exchange-algorithms","random-key-generator","secure"],"created_at":"2025-03-11T08:57:08.020Z","updated_at":"2025-04-14T07:42:50.902Z","avatar_url":"https://github.com/NTDLS.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NTDLS.SecureKeyExchange\n\n📦 Be sure to check out the NuGet package: https://www.nuget.org/packages/NTDLS.SecureKeyExchange\n\nEasily generate a single or multi-round Diffie-Hellman key C#.\n\n**Scenario (use your imagination):**\n* localHost is a local service.\n* remotePeer is a remote peer.\n\n```csharp\n//localHost starts the process with a call to GenerateNegotiationToken(),\n//  specifying the size of the key (which is actually n*16).\nvar localHost = new CompoundNegotiator();\nbyte[] negotiationToken = localHost.GenerateNegotiationToken(8);\n\n//localHost passes the resulting bytes from GenerateNegotiationToken()\n//  to a remote peer which passes the bytes to ApplyNegotiationToken().\nvar remotePeer = new CompoundNegotiator();\nbyte[] negotiationReply = remotePeer.ApplyNegotiationToken(negotiationToken);\n\n//The remotePeer passes the bytes from ApplyNegotiationToken() back to the \n//  localHost, where the localHost passes them to ApplyNegotiationResponseToken()\nlocalHost.ApplyNegotiationResponseToken(negotiationReply);\n\n//At this point, both the localHost and the remotePeer have the same bytes in\n//  \"SharedSecret\" as we can see from comparing the \"SharedSecretHash\".\nif (remotePeer.SharedSecretHash != localHost.SharedSecretHash)\n{\n    throw new Exception(\"This should never happen.\");\n}\n\nConsole.WriteLine($\"Key length: {localHost.KeyLength} bytes.\");\nConsole.WriteLine($\" Local Shared Secret: {localHost.SharedSecretHash}\");\nConsole.WriteLine($\"Remote Shared Secret: {remotePeer.SharedSecretHash}\");\n```\n\n## License\n[[Apache-2.0](https://choosealicense.com/licenses/apache-2.0/)](https://choosealicense.com/licenses/mit/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntdls%2Fntdls.securekeyexchange","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntdls%2Fntdls.securekeyexchange","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntdls%2Fntdls.securekeyexchange/lists"}