{"id":15517558,"url":"https://github.com/bodgit/srp","last_synced_at":"2025-10-26T15:44:59.546Z","repository":{"id":62866498,"uuid":"558109657","full_name":"bodgit/srp","owner":"bodgit","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-05T19:06:45.000Z","size":55,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-13T02:18:18.653Z","etag":null,"topics":["cognito","rfc-2945","rfc-5054","srp","srp-6a"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bodgit.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":"2022-10-26T23:09:33.000Z","updated_at":"2024-05-03T17:00:06.000Z","dependencies_parsed_at":"2023-12-07T02:23:14.467Z","dependency_job_id":"b873bc42-67d2-40c5-b939-417e6247e292","html_url":"https://github.com/bodgit/srp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodgit%2Fsrp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodgit%2Fsrp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodgit%2Fsrp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodgit%2Fsrp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bodgit","download_url":"https://codeload.github.com/bodgit/srp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543602,"owners_count":20955865,"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":["cognito","rfc-2945","rfc-5054","srp","srp-6a"],"created_at":"2024-10-02T10:13:46.681Z","updated_at":"2025-10-26T15:44:59.487Z","avatar_url":"https://github.com/bodgit.png","language":"Go","readme":"[![GitHub release](https://img.shields.io/github/v/release/bodgit/srp)](https://github.com/bodgit/srp/releases)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/bodgit/srp/main.yml?branch=main)](https://github.com/bodgit/srp/actions?query=workflow%3Abuild)\n[![Coverage Status](https://coveralls.io/repos/github/bodgit/srp/badge.svg?branch=main)](https://coveralls.io/github/bodgit/srp?branch=main)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bodgit/srp)](https://goreportcard.com/report/github.com/bodgit/srp)\n[![GoDoc](https://godoc.org/github.com/bodgit/srp?status.svg)](https://godoc.org/github.com/bodgit/srp)\n![Go version](https://img.shields.io/badge/Go-1.19-brightgreen.svg)\n![Go version](https://img.shields.io/badge/Go-1.18-brightgreen.svg)\n\n# SRP\n\nAn implementation of SRP-6a as documented in [RFC 5054](https://www.rfc-editor.org/rfc/rfc5054) and [RFC 2945](https://www.rfc-editor.org/rfc/rfc2945). It also exports modified versions of routines allowing it to be used with [AWS Cognito](https://aws.amazon.com/cognito/) which uses a variation of SRP.\n\nGenerate the verifier:\n```golang\npackage main\n\nimport \"github.com/bodgit/srp\"\n\nfunc main() {\n\tg, err := srp.GetGroup(1024)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ts, err := srp.NewSRP(crypto.SHA1, g)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ti, err := s.NewISV(\"username\", \"password\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Marshal and store i on the server against the identity\n}\n```\n\nExample client:\n```golang\npackage main\n\nimport \"github.com/bodgit/srp\"\n\nfunc main() {\n\tg, err := srp.GetGroup(1024)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ts, err := srp.NewSRP(crypto.SHA1, g)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tclient, err := s.NewClient(\"username\", \"password\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Send identity and client.A() to the server, receive salt and B\n\n\tm1, err := client.Compute(salt, b)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Send m1 to the server, receive m2\n\n\tif err := client.Check(m2); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Use client.Key()\n}\n```\n\nExample server:\n```golang\npackage main\n\nimport \"github.com/bodgit/srp\"\n\nfunc main() {\n\tg, err := srp.GetGroup(1024)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ts, err := srp.NewSRP(crypto.SHA1, g)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Receive identity and A from client, lookup/unmarshal ISV i\n\n\tserver, err := s.NewServer(i, a)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Send server.Salt() and server.B() to the client, receive m1\n\n\tm2, err := server.Check(m1)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Send m2 to the client, use server.Key()\n}\n```\n## Other implementations\n\n* [https://github.com/opencoff/go-srp](https://github.com/opencoff/go-srp) - Calculates verifier value differently compared to RFC so session keys never match\n* [https://github.com/Kong/go-srp](https://github.com/Kong/go-srp) - Calculates proof values differently compared to RFC but session keys match\n* [https://github.com/posterity/srp](https://github.com/posterity/srp) - Interoperates fine\n\nThe last two implementations however assume that the client knows their salt value from the start rather than waiting for the server to provide it which doesn't match the behaviour documented in the RFC.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodgit%2Fsrp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodgit%2Fsrp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodgit%2Fsrp/lists"}