{"id":19219648,"url":"https://github.com/picolab/node-sovrin-did","last_synced_at":"2025-09-11T21:09:28.488Z","repository":{"id":57366547,"uuid":"100736164","full_name":"Picolab/node-sovrin-did","owner":"Picolab","description":"node.js module to generate DID and Ed25519 keys to use with Sovrin","archived":false,"fork":false,"pushed_at":"2020-08-08T15:09:06.000Z","size":33,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-01T23:47:18.202Z","etag":null,"topics":["cryptography","decentralized","identity","sovrin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Picolab.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":"2017-08-18T17:38:42.000Z","updated_at":"2022-03-30T11:15:52.000Z","dependencies_parsed_at":"2022-08-23T20:10:40.492Z","dependency_job_id":null,"html_url":"https://github.com/Picolab/node-sovrin-did","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Picolab/node-sovrin-did","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picolab%2Fnode-sovrin-did","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picolab%2Fnode-sovrin-did/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picolab%2Fnode-sovrin-did/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picolab%2Fnode-sovrin-did/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Picolab","download_url":"https://codeload.github.com/Picolab/node-sovrin-did/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Picolab%2Fnode-sovrin-did/sbom","scorecard":{"id":109965,"data":{"date":"2025-08-11","repo":{"name":"github.com/Picolab/node-sovrin-did","commit":"d37dad2ea03c215f19460dffa8a1e9607ddb45f0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":2,"reason":"Found 3/14 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T11:57:57.141Z","repository_id":57366547,"created_at":"2025-08-15T11:57:57.141Z","updated_at":"2025-08-15T11:57:57.141Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274705157,"owners_count":25334472,"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","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cryptography","decentralized","identity","sovrin"],"created_at":"2024-11-09T14:32:22.289Z","updated_at":"2025-09-11T21:09:28.433Z","avatar_url":"https://github.com/Picolab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-sovrin-did\n\n[![build status](https://secure.travis-ci.org/Picolab/node-sovrin-did.svg)](https://travis-ci.org/Picolab/node-sovrin-did)\n\nnode.js module to generate DID and Ed25519 keys to use with [Sovrin](https://sovrin.org/)\n\n\n## Install\n\n```sh\n$ npm i sovrin-did\n```\n\n\n## Example\n\n```js\nvar sovrinDID = require(\"sovrin-did\");\n\nvar d = sovrinDID.gen();\n\nconsole.log(d);\n```\noutput:\n```js\n{ did: 'S7evWWTSbaXELyE9w53sFr',\n  verifyKey: 'EgvhZsLKSsqsbNBfJ2wfR9FFWo9YqkpxpfXeT4ifR1Cq',\n  encryptionPublicKey: '5UAXeov4Gi7ioSTLDoMPtdvqX6RRmJcQAWagVgdaxUej',\n  secret:\n   { seed: '36a572a7e43956784b517c57b26720a8ef838d114c0619f1d8c7801c37fa4f6a',\n     signKey: '4gKLe7Qq2WX249NBfymQySZbAzXboq2emMig6wBR82Bj',\n     encryptionPrivateKey: '7H25Jfb2ND51hhaomL5FPhhqQvBGujd1jJeSjZZ8HQzR'} }\n```\n\n\n## API\n\n\n### gen()\n\nGenerates a new did, verification key, signing key, and also gives you the seed used to generate them. It also includes the public and private key used for encryption.\n\n```js\n{\n    did: \"\u003cbase58 did\u003e\",\n    verifyKey: \"\u003cbase58 publicKey\u003e\",\n    publicKey: \"\u003cbase58 publicKey\u003e\",\n\n    secret: {\n        seed: \"\u003chex encoded 32-byte seed\u003e\",\n        signKey: \"\u003cbase58 secretKey\u003e\",\n        privateKey: \"\u003cbase58 privateKey\u003e\"\n    }\n}\n```\n\n\n### fromSeed(seed)\n\nSame as `.gen()` except you supply the seed. The seed should be a 32-byte Uint8Array (i.e. Buffer).\n\nExample:\n```\nvar seed = Buffer.from(\"36a572a7e43956784b517c57b26720a8ef838d114c0619f1d8c7801c37fa4f6a\", \"hex\");\n\nvar d = sovrinDID.fromSeed(seed);\n\nconsole.log(d);\n```\n\nThe output is the same as the `.gen()` example.\n\n\n### signMessage(message, signKey, verifyKey)\n\nSigns a message with the given signKey and verifyKey.\n\n* The message should be a string.\n* Both the signKey and verifyKey should be the signKey and verifyKey given from the `gen()` or `fromSeed(seed)` methods\n\nReturns a signed message as a Uint8Array (i.e. Buffer).\n\nExample:\n```js\n  var sovrin = sovrinDID.gen();\n \n  var signKey = sovrin.secret.signKey;\n  var verifyKey = sovrin.verifyKey;\n  var message = \"Hello World!!\";\n \n  var signedMessage = sovrinDID.signMessage(message, signKey, verifyKey);\n```\n\n\n### verifySignedMessage(signedMessage, verifyKey)\n\nVerifies that the given message  has been signed by the possessor of the given verifyKey.\n\n* The signedMessage should be what is returned from `signMessage(message, signKey, verifyKey)`\n* The verifyKey should be the verifyKey given from the `gen()` or `fromSeed(seed)` methods\n\nReturns the original message if the message was signed by the owner of the verifyKey `false` otherwise.\n\nExample:\n```js\n  var sovrin = sovrinDID.gen();\n  var sovrin2 = sovrinDID.gen();\n \n  var signKey = sovrin.secret.signKey;\n  var verifyKey = sovrin.verifyKey;\n  var verifyKey2 = sovrin2.verifyKey;\n \n  var message = \"Hello World!!\";\n \n  var signedMessage = sovrinDID.signMessage(message, signKey, verifyKey);\n \n  console.log(sovrinDID.verifySignedMessage(signedMessage, verifyKey));\n  console.log(sovrinDID.verifySignedMessage(signedMessage, verifyKey2));\n```\n\nOutput:\n```\n  Hello World!!\n  false\n```\n\n\n### getKeyPairFromSignKey(signKey)\n\nReturns a key pair that is valid to use for encrypting. \n* The signKey should be the signKey given from the object given from `gen()` or `fromSeed()`\n\nExample:\n```js\nvar sovrin = sovrinDID.gen();\nvar signKey = sovrin.secret.signKey;\n\nvar keyPair = sovrinDID.getKeyPairFromSignKey(signKey);\nconsole.log(keyPair);\n```\n\nOutput:\n```js\n{\n   publicKey: ...   // Uint8Array with 32-byte public key\n   secretKey: ...   // Uint8Array with 32-byte secret key\n}\n```\n\n\n### getNonce()\n\nReturns a random nonce as a Uint8Array that can be used for encrypting.\n\nExample:\n```js\nvar nonce = sovrinDID.getNonce();\n```\n\n\n### getSharedSecret(theirVerifyKey, mySigningKey)\n\nComputes a sharedSecret to be used for encryption.\n\n* theirVerifyKey should be the publicKey given from the `getKeyPairFromSignKey(signKey)` method or the publicKey string given from the `gen()` method.\n* mySigningKey should be the secretKey given from the `getKeyPairFromSignKey(signKey)` method or the privateKey given from the `gen()` method.\n\nExample:\n```js\nvar sovrin1 = sovrinDID.gen();\nvar sovrin2 = sovrinDID.gen();\n\n// Using the strings given via the gen() method\nvar sharedSecret1 = sovrinDID.getSharedSecret(sovrin2.encryptionPublicKey, sovrin1.secret.encryptionPrivateKey);\nvar sharedSecret2 = sovrinDID.getSharedSecret(sovrin1.encryptionPublicKey, sovrin2.secret.encryptionPrivateKey);\n\nvar signKey1 = sovrin1.secret.signKey;\nvar signKey2 = sovrin2.secret.signKey;\n\nvar keyPair1 = sovrinDID.getKeyPairFromSignKey(signKey1);\nvar keyPair2 = sovrinDID.getKeyPairFromSignKey(signKey2);\n\n// Using the buffer given from the getKeyPairFromSignKey(signKey2) method\nvar sharedSecret3 = sovrinDID.getSharedSecret(keyPair2.publicKey, keyPair1.secretKey);\nvar sharedSecret4 = sovrinDID.getSharedSecret(keyPair1.publicKey, keyPair2.secretKey);\n\n// All the secrets generated are equivalent\n```\n\n\n### encryptMessage(message, nonce, sharedSecret)\n\nEncrypts a the given message using a precomputed sharedSecret.\n* message should be given as a string\n* nonce should be a nonce from the `getNonce()` method \n    * Note: The nonce used for encrypting and decrypting need to be the same\n* sharedSecret should be computed using the `getSharedSecret(theirVerifyKey, mySigningKey)` method\n\nExample:\n\n```js\nvar sovrin1 = sovrinDID.gen();\nvar sovrin2 = sovrinDID.gen();\n\nvar signKey1 = sovrin1.secret.signKey;\nvar signKey2 = sovrin2.secret.signKey;\n\nvar keyPair1 = sovrinDID.getKeyPairFromSignKey(signKey1);\nvar keyPair2 = sovrinDID.getKeyPairFromSignKey(signKey2);\nvar sharedSecret1To2 = sovrinDID.getSharedSecret(keyPair2.publicKey, keyPair1.secretKey);\n\nvar message = \"Hello World!!\";\nvar nonce = sovrinDID.getNonce();\nvar encryptedMessage = sovrinDID.encryptMessage(message, nonce, sharedSecret1To2);\n```\n\n\n### decryptMessage(encryptedMessage, nonce, sharedSecret)\n\nVerifies and decrypts a previously encrypted message.\n* encryptedMessage should be what is returned from the `encryptMessage(message, nonce, sharedSecret)` method\n* nonce should be a nonce given from the `getNonce()` method\n    * Note: The nonce used for encrypting and decrypting need to be the same\n* sharedSecret should be computed using the `getSharedSecret(theirVerifyKey, mySigningKey)` method\n\nExample:\n```js\nvar signKey1 = \"4bMnc36WuLYJqsWTZtiazJJrtkvPwgyWnirn7gKk7ium\";\nvar signKey2 = \"516mChDX1BRjwHJc2w838W8cXxy8a6Eb35HKXjPR2fD8\";\nvar signKey3 = \"7H25Jfb2ND51hhaomL5FPhhqQvBGujd1jJeSjZZ8HQzR\";\n\nvar keyPair1 = sovrinDID.getKeyPairFromSignKey(signKey1);\nvar keyPair2 = sovrinDID.getKeyPairFromSignKey(signKey2);\nvar keyPair3 = sovrinDID.getKeyPairFromSignKey(signKey3);\n\nvar sharedSecret1To2 = sovrinDID.getSharedSecret(keyPair2.publicKey, keyPair1.secretKey);\nvar sharedSecret2To1 = sovrinDID.getSharedSecret(keyPair1.publicKey, keyPair2.secretKey);\nvar sharedSecret3To1 = sovrinDID.getSharedSecret(keyPair3.publicKey, keyPair1.secretKey);\n\nvar message = \"Hello World!!\";\nvar nonce = sovrinDID.getNonce();\n\nvar encryptedMessage = sovrinDID.encryptMessage(message, nonce, sharedSecret1To2);\nvar decryptedMessage = sovrinDID.decryptMessage(encryptedMessage, nonce, sharedSecret2To1);\nvar attemptedDecryption = sovrinDID.decryptMessage(encryptedMessage, nonce, sharedSecret3To1);\n\nconsole.log(decryptedMessage);\nconsole.log(attemptedDecryption);\n```\n\nOutput:\n```\nHello World!!\nfalse\n```\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicolab%2Fnode-sovrin-did","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicolab%2Fnode-sovrin-did","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicolab%2Fnode-sovrin-did/lists"}