{"id":20026290,"url":"https://github.com/macmade/srpxx","last_synced_at":"2026-01-31T19:01:59.062Z","repository":{"id":262527850,"uuid":"884344340","full_name":"macmade/SRPXX","owner":"macmade","description":"C++ implementation of the Secure Remote Password protocol (SRP) - RFC 5054.","archived":false,"fork":false,"pushed_at":"2024-11-14T18:05:59.000Z","size":1815,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-17T12:44:13.082Z","etag":null,"topics":["authentication","cplusplus","cpp","openssl","rfc-5054","secure-remote-password","srp","srp-6a","ssl"],"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/macmade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"github":"macmade"}},"created_at":"2024-11-06T15:26:42.000Z","updated_at":"2024-11-14T18:06:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"f72e3b67-41e8-4dd9-8597-4c7a72679c88","html_url":"https://github.com/macmade/SRPXX","commit_stats":null,"previous_names":["macmade/srpxx"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/macmade/SRPXX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2FSRPXX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2FSRPXX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2FSRPXX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2FSRPXX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macmade","download_url":"https://codeload.github.com/macmade/SRPXX/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macmade%2FSRPXX/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28950279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["authentication","cplusplus","cpp","openssl","rfc-5054","secure-remote-password","srp","srp-6a","ssl"],"created_at":"2024-11-13T09:06:06.925Z","updated_at":"2026-01-31T19:01:59.056Z","avatar_url":"https://github.com/macmade.png","language":"C++","funding_links":["https://github.com/sponsors/macmade"],"categories":[],"sub_categories":[],"readme":"SRPXX\n=====\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/macmade/SRPXX/ci-mac.yaml?label=macOS\u0026logo=apple)](https://github.com/macmade/SRPXX/actions/workflows/ci-mac.yaml)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/macmade/SRPXX/ci-win.yaml?label=Windows\u0026logo=cplusplus)](https://github.com/macmade/SRPXX/actions/workflows/ci-win.yaml)\n[![Issues](http://img.shields.io/github/issues/macmade/SRPXX.svg?logo=github)](https://github.com/macmade/SRPXX/issues)\n![Status](https://img.shields.io/badge/status-active-brightgreen.svg?logo=git)\n![License](https://img.shields.io/badge/license-mit-brightgreen.svg?logo=open-source-initiative)  \n[![Contact](https://img.shields.io/badge/follow-@macmade-blue.svg?logo=twitter\u0026style=social)](https://twitter.com/macmade)\n[![Sponsor](https://img.shields.io/badge/sponsor-macmade-pink.svg?logo=github-sponsors\u0026style=social)](https://github.com/sponsors/macmade)\n\n### About\n\nC++ implementation of the Secure Remote Password protocol (SRP) - RFC 5054.\n\n**Supported Hash Algorithms:**\n\n - SHA-1\n - SHA-224\n - SHA-256\n - SHA-384\n - SHA-512\n\n**Supported Group Parameters:**\n\n - 1024 bits\n - 1536 bits\n - 2048 bits\n - 3072 bits\n - 4096 bits\n - 6144 bits\n - 8192 bits\n\n### Example Usage\n\n```cpp\n\n#include \u003cSRPXX.hpp\u003e\n\n// Server storage\nstd::vector\u003c uint8_t \u003e salt;\nstd::vector\u003c uint8_t \u003e verifier;\n\n/* Registration */\n{\n    // Create a SRP client for an identity, with a given hash algorithm and group type\n    SRP::Client client( \"milford@cubicle.org\", SRP::HashAlgorithm::SHA256, SRP::Client::GroupType::NG2048 );\n    \n    // User registers with a password\n    client.setPassword( \"1234\" );\n    \n    // Client generates a salt\n    client.setSalt( SRP::Random::bytes( 16 ) );\n    \n    // Client -\u003e Server:\n    // Server receives salt and verifier from Client\n    // Client can then discard them\n    salt     = client.salt();\n    verifier = client.v().bytes( SRP::BigNum::Endianness::BigEndian );\n}\n\n/* Authentication */\n{\n    SRP::Client client( \"milford@cubicle.org\", SRP::HashAlgorithm::SHA256, SRP::Client::GroupType::NG2048 );\n    SRP::Server server( \"milford@cubicle.org\", SRP::HashAlgorithm::SHA256, SRP::Client::GroupType::NG2048 );\n    \n    // Server has stored salt and verifier during registration (see above)\n    server.setSalt( salt );\n    server.setV( SRP::BigNum( verifier, SRP::BigNum::Endianness::BigEndian ) );\n    \n    // Client -\u003e Server:\n    // Server receives A from Client\n    server.setA( client.A() );\n    \n    // Server -\u003e Client:\n    // Client receives B and salt from Server\n    client.setB( server.B() );\n    client.setSalt( server.salt() );\n    \n    // User inputs a wrong password\n    client.setPassword( \"4321\" );\n    \n    // Client and Server will not have matching M1 and M2, meaning the authentication failed\n    AssertFalse( client.M1() == server.M1() );\n    AssertFalse( client.M2() == server.M2() );\n    \n    // User inputs the correct password\n    client.setPassword( \"1234\" );\n    \n    // With the correct password, Client and Server will have matching M1 and M2, meaning the authentication was successful\n    AssertTrue( client.M1() == server.M1() );\n    AssertTrue( client.M2() == server.M2() );\n}\n\n```\n\nRequirements\n------------\n\nThis project requires OpenSSL.  \nA pre-built version of BoringSSL is provided for macOS and Windows in the `Submodules/BoringSSL/lib` directory.\n\nBuilding\n--------\n\n### macOS\n\nAn Xcode project is provided: `SRPXX.xcodeproj`.  \nIt contains targets for the library and the debug tool.\n\n### Windows\n\nA Visual Studio solution is provided: `SRPXX.sln`.\nThe library is available for the following toolsets and architectures:\n\n - v142 - x86\n - v142 - x64\n - v143 - x86\n - v143 - x64\n\nTest Vectors\n------------\n\nTest vectors are provided in the `SRPXX-Tests/Test-Vectors` directory for all supported hash algorithms and group parameters.\n\nDebug Tool\n----------\n\nA debug CLI tool is provided in the `SRPXX-Debug` directory:\n\n```\nUsage: srp \u003cidentity\u003e \u003cpassword\u003e \u003chash algorithm\u003e \u003cgroup parameter\u003e\n\n    - Supported hash algorithms:  sha1 sha224 sha256 sha384 sha512\n    - Supported group parameters: 1024 1536 2048 3072 4096 6144 8192\n```\n\nWhen invoked, it will output test vectors with all values used during the SRP session:\n\n```cpp\nSRP::HashAlgorithm::SHA1,\nSRP::Base::GroupType::NG1024,\n\"milford@cubicle.org\",\n\"1234\",\n{\n    /* Salt */\n    0xC8, 0x2B, 0x40, 0xC5, 0xB9, 0x6A, 0x38, 0x2C, 0x84, 0x0D, 0xA8, 0xD2, 0x04, 0x83, 0x8A, 0xAB, ...\n},\n{\n    /* Verifier */\n    0xAD, 0x4F, 0xAB, 0x4A, 0x68, 0x89, 0x9A, 0x18, 0x6C, 0x38, 0x1B, 0xC4, 0x20, 0x55, 0x02, 0xB3, ...\n},\n{\n    /* a */\n    0x43, 0xC7, 0xA0, 0xDD, 0x9A, 0xE4, 0x2B, 0x34, 0x52, 0x0D, 0xDC, 0xCE, 0xE8, 0x68, 0xB6, 0x8E, ...\n},\n{\n    /* A */\n    0x18, 0x25, 0x6F, 0xED, 0x07, 0xD6, 0xA1, 0xB2, 0x91, 0x58, 0xDB, 0xFC, 0x49, 0x2F, 0x23, 0xCC, ...\n},\n{\n    /* b */\n    0xD7, 0x17, 0x11, 0x2D, 0x6F, 0x02, 0xCD, 0xB4, 0x92, 0x0D, 0xBD, 0x42, 0x94, 0x15, 0xCA, 0xB0, ...\n},\n{\n    /* B */\n    0xEE, 0x7E, 0xE2, 0x67, 0x18, 0x1D, 0x3A, 0x0E, 0x05, 0x83, 0x86, 0x27, 0x78, 0x30, 0x18, 0xE2, ...\n},\n{\n    /* u */\n    0xA3, 0x5E, 0x6C, 0xF9, 0x44, 0xC2, 0x93, 0xC9, 0x2D, 0x70, 0x51, 0x77, 0xD9, 0xCF, 0x54, 0xD7, ...\n},\n{\n    /* k */\n    0x75, 0x56, 0xAA, 0x04, 0x5A, 0xEF, 0x2C, 0xDD, 0x07, 0xAB, 0xAF, 0x0F, 0x66, 0x5C, 0x3E, 0x81, ...\n},\n{\n    /* S */\n    0xEA, 0xD5, 0x20, 0xA6, 0xD1, 0x9C, 0x34, 0xEB, 0x94, 0x3E, 0xAA, 0x5E, 0x03, 0x51, 0xA7, 0x48, ...\n},\n{\n    /* x */\n    0xBC, 0x07, 0xB5, 0x14, 0xB8, 0xF9, 0x86, 0xC2, 0xA5, 0x19, 0xC2, 0x80, 0x99, 0x81, 0xB6, 0x90, ...\n},\n{\n    /* K */\n    0x28, 0xE9, 0x54, 0xDC, 0xDC, 0x50, 0x6A, 0xBA, 0x2D, 0x64, 0xEF, 0xB2, 0x04, 0xB0, 0xCC, 0x5D, ...\n},\n{\n    /* M1 */\n    0x5D, 0x09, 0x99, 0x64, 0x42, 0xF3, 0x27, 0x2B, 0xA1, 0x48, 0x82, 0x0C, 0xE7, 0x87, 0x8C, 0x36, ...\n},\n{\n    /* M2 */\n    0xDB, 0xE4, 0xF8, 0x2E, 0xE7, 0x06, 0x28, 0x5D, 0x60, 0x0C, 0x66, 0xB1, 0xA7, 0xD0, 0xB5, 0x53, ...\n}\n```\n\nLicense\n-------\n\nProject is released under the terms of the MIT License.\n\nRepository Infos\n----------------\n\n    Owner:          Jean-David Gadina - XS-Labs\n    Web:            www.xs-labs.com\n    Blog:           www.noxeos.com\n    Twitter:        @macmade\n    GitHub:         github.com/macmade\n    LinkedIn:       ch.linkedin.com/in/macmade/\n    StackOverflow:  stackoverflow.com/users/182676/macmade\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacmade%2Fsrpxx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacmade%2Fsrpxx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacmade%2Fsrpxx/lists"}