{"id":20083577,"url":"https://github.com/shlima/srp6a-webcrypto","last_synced_at":"2026-01-05T01:32:41.450Z","repository":{"id":100975683,"uuid":"462059392","full_name":"shlima/srp6a-webcrypto","owner":"shlima","description":"pure javascript implementation of SRP-6a (RFC-5054, RFC-2945) using webcrypto","archived":false,"fork":false,"pushed_at":"2022-03-30T21:04:53.000Z","size":187,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T09:48:49.068Z","etag":null,"topics":["crypto","javascript","srp6a","webcrypto"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shlima.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-02-21T23:00:13.000Z","updated_at":"2024-12-16T14:14:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d6bda79-5d8e-45cc-8588-a840d0f9e2e1","html_url":"https://github.com/shlima/srp6a-webcrypto","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"f4af10d57b20efb8ec4fc2db0c0f9959db46c0a2"},"previous_names":["wault-pw/srp6a-webcrypto"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shlima%2Fsrp6a-webcrypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shlima%2Fsrp6a-webcrypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shlima%2Fsrp6a-webcrypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shlima%2Fsrp6a-webcrypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shlima","download_url":"https://codeload.github.com/shlima/srp6a-webcrypto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244734087,"owners_count":20501014,"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":["crypto","javascript","srp6a","webcrypto"],"created_at":"2024-11-13T15:47:49.768Z","updated_at":"2026-01-05T01:32:41.414Z","avatar_url":"https://github.com/shlima.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# srp6a-webcrypto\n\n[![Test](https://github.com/wault-pw/srp6a-webcrypto/actions/workflows/test.yml/badge.svg)](https://github.com/oka-is/srp6a-webcrypto/actions/workflows/test.yml)\n\nThis is tiny Javascript SRP6a implementation\nfully complies with the RFC-5054/RFC-2945.\n\nIt uses built-in crypto primitives from Web crypto \nAPI in a browser (cryptographically strong \nrandom number generator and hash functions).\n\nThis client is used with [golang](https://github.com/wault-pw/srp6ago) \nSRP6a server implementation.\n\n\n## Installation\n\n```bash\nyarn add @wault-pw/srp6a-webcrypto\n```\n\n## Usage\n\nAll internal operations are made with byte sequence \n(build in type `Uint8Array`), all returned values are also\nbytes, so it's up to you how to encode the communication \nbetween client and server (protobuf or HEX representation with JSON).\n\n### Registration flow\n\n```js\nimport {SrpClient, RFC5054b1024Sha1} from \"@wault-pw/srp6a-webcrypto\"\n\nconst client = new SrpClient(\"login\", \"password\", RFC5054b1024Sha1)\n\nclient.seed(await client.randomSalt())\nconst verifier = await client.verifier()\nconst identifier = client.username\nconst salt = client.salt\n// send identifier, verifier and salt to the server\n```\n\n### Login flow\n\n```js\nimport {SrpClient, RFC5054b1024Sha1} from \"@wault-pw/srp6a-webcrypto\"\n\nconst client = new SrpClient(\"login\", \"password\", RFC5054b1024Sha1)\n\n// 1) send user identifier to the server\n// 2) get a salt and server public key from server response\nconst {salt, serverPublickKey} = await fetch(`?username=${identifier}`)\nclient.seed(salt)\n\nconst challenge = await client.setServerPublicKey(serverPublickKey)\n\n// 3) send client's public key and proof to the server\nconst proof = challenge.proof\nconst publicKey = challenge.publicKey\nconst {serverProof} = await fetch(`?proof=${proof}\u0026publicKey=${publicKey}`)\n\n// 4) get server proof and validate it\nchallenge.isProofValid(serverProof)\n// 5) now you have identical session key with server\nchallenge.secretKey()\n```\n\n## SRP Group Parameters\n\nPreconfigured RFC-5054 SRP Group Parameters:\n\n```js\n// RFC-5054 complicated params set:\nimport {\n  RFC5054b1024Sha1,\n  RFC5054b1536Sha1,\n  RFC5054b2048Sha1,\n  RFC5054b3072Sha1,\n  RFC5054b4096Sha1,\n  RFC5054b6144Sha1,\n  RFC5054b8192Sha1,\n} from \"@wault-pw/srp6a-webcrypto\"\n\n// RFC-5054 complicated set,\n// with non-standart hash function SHA-256\nimport {\n  RFC5054b8192Sha256,\n  RFC5054b6144Sha256,\n  RFC5054b4096Sha256,\n  RFC5054b1024Sha256,\n  RFC5054b1536Sha256,\n  RFC5054b2048Sha256,\n  RFC5054b3072Sha256\n} from \"@wault-pw/srp6a-webcrypto\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshlima%2Fsrp6a-webcrypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshlima%2Fsrp6a-webcrypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshlima%2Fsrp6a-webcrypto/lists"}