{"id":15497544,"url":"https://github.com/bcomnes/sodium-cli","last_synced_at":"2025-10-14T18:42:47.139Z","repository":{"id":57365671,"uuid":"176613449","full_name":"bcomnes/sodium-cli","owner":"bcomnes","description":"A simple CLI frontend for common sodium-native actions","archived":false,"fork":false,"pushed_at":"2019-03-27T22:23:08.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-16T03:49:28.501Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://npmjs.com/sodium-cli","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/bcomnes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-03-19T23:18:46.000Z","updated_at":"2019-04-15T00:55:38.000Z","dependencies_parsed_at":"2022-08-23T19:00:54.638Z","dependency_job_id":null,"html_url":"https://github.com/bcomnes/sodium-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/bcomnes/sodium-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fsodium-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fsodium-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fsodium-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fsodium-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcomnes","download_url":"https://codeload.github.com/bcomnes/sodium-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcomnes%2Fsodium-cli/sbom","scorecard":{"id":228751,"data":{"date":"2025-08-11","repo":{"name":"github.com/bcomnes/sodium-cli","commit":"fc3494028d926b770c4b10f26db07fa18995ab9c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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"}}]},"last_synced_at":"2025-08-17T04:23:44.495Z","repository_id":57365671,"created_at":"2025-08-17T04:23:44.495Z","updated_at":"2025-08-17T04:23:44.495Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020357,"owners_count":26086867,"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-10-14T02:00:06.444Z","response_time":60,"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":[],"created_at":"2024-10-02T08:39:41.861Z","updated_at":"2025-10-14T18:42:47.108Z","avatar_url":"https://github.com/bcomnes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sodium-cli\n\n[![npm version][npm-img]][npm] [![build status][travis-img]][travis]\n\nA simple CLI frontend for [sodium-native](https://github.com/sodium-friends/sodium-native) actions.\n\n## Installation\n\n```console\nnpm install sodium-cli -g\n```\n\n## Usage\n\n`sodium-cli` ships with a few cli commands and a common.js api.\n\nThe CLI ships three commands:\n\n```console\n$ keygen\n\nkey.public and key.secret written to /Users/bret/repos/sodium-cli\n\n$ sign index.js\n\n6be2ee42223ac80784c9ad19c3898a35a0ac012ae0938e546deda8d479291494c316eb2f2a3bb1dda695fbe84819de8a9ec43f356b69bd7f0cf0190b11230809\n\n$ verify 6be2ee42223ac80784c9ad19c3898a35a0ac012ae0938e546deda8d479291494c316eb2f2a3bb1dda695fbe84819de8a9ec43f356b69bd7f0cf0190b11230809 index.js\n\nValid signature for index.js by ./key.public\n```\n\nThere is also an API counterpart for each command:\n\n```js\nconst sodiumCLI = require('sodium-cli')\nconst cwd = process.cwd()\n\nsodiumCLI.keygen(cwd, err =\u003e {\n  if (err) throw err\n  sodiumCLI.sign('./secret.key', './some-file', (err, sig) =\u003e {\n    if (err) throw err\n    sodiumCLI.verify(sig, './public.key', './some-file', (err, valid) =\u003e {\n      if (err) throw err\n      console.log(valid ? 'Signature is valid' : 'Signature is invalid' )\n    })\n  })\n})\n```\n\n## CLI\n\n### `keygen`\n\nGenerate a libsodium [crypto_sign keypair](https://download.libsodium.org/doc/public-key_cryptography/public-key_signatures#key-pair-generation) and save it to disk.\n\n```console\n$ keygen --help\n\nsodium-cli keygen: Generate a libsodium crypto_sign keypair and save it to disk\n\nUsage: keygen {options}\n    --dest, -d            path to save keypair (default: \".\")\n    --force, -f           overwrite existing key files (default: false)\n    --help, -h            show help\n    --version, -v         print the version of the program\n\n$ keygen\n\nkey.public and key.secret written to /Users/bret/repos/sodium-cli\n\n$ ls key*\n\nkey.public key.secret\n```\n\nIf `keygen` finds any existing keys in the destination directory, it will refuse to generate new keys unless you pass the `--force` flag.\n\n### `sign [file]`\n\n[Sign](https://libsodium.gitbook.io/doc/public-key_cryptography/public-key_signatures#detached-mode) a file with a libsodium crypto_sign secret key and print to stdout.\n\n```console\n$ sign --help\n\nsodium-cli sign: Sign a file with a libsodium crypto_sign secret key and print to stdout\n\nUsage: sign [file] {options}\n    --secret, -s          path to secret key to sign with (default: \"./key.secret\")\n    --help, -h            show help\n    --version, -v         print the version of the program\n\n$ sign index.js\n6be2ee42223ac80784c9ad19c3898a35a0ac012ae0938e546deda8d479291494c316eb2f2a3bb1dda695fbe84819de8a9ec43f356b69bd7f0cf0190b11230809\n```\n\n### `verify [signature] [public key]`\n\n[Verify](https://libsodium.gitbook.io/doc/public-key_cryptography/public-key_signatures#detached-mode) a file with a libsodium crypto_sign public key and signature.\n\n```console\n$ verify\nsodium-cli verify: Verify a file with a libsodium crypto_sign public key and signature\n\nUsage: verify [signature] [file] {options}\n    --public, -p          path to public key file to verify with (default: \"./key.public\")\n    --help, -h            show help\n    --version, -v         print the version of the program\n$ verify 6be2ee42223ac80784c9ad19c3898a35a0ac012ae0938e546deda8d479291494c316eb2f2a3bb1dda695fbe84819de8a9ec43f356b69bd7f0cf0190b11230809 index.js\n\nValid signature for index.js by ./key.public\n\n$ verify badSig index.js\n\nERROR: Signature appears invalid\n```\n\n## API\n\n### `sodiumCLI.keygen(destination, callback)`\n\nGenerate a libsodium [crypto_sign keypair](https://download.libsodium.org/doc/public-key_cryptography/public-key_signatures#key-pair-generation) and save it to a `destination` path as `destination/public.key` and `destination/secret.key`.  Any existing key files are overwritten.\n\nCallback is called with `(err)` after the key files are written to disk.\n\n### `sodiumCLI.sign(secretPath, filePath, callback)`\n\n[Sign](https://libsodium.gitbook.io/doc/public-key_cryptography/public-key_signatures#detached-mode) a file at `filePath` with a libsodium crypto_sign secret key located at `secretPath`.\n\nCallback is called with `(err, signature)` where `signature` is the hex representation of the signature.\n\n### `sodiumCLI.verify(signature, publicPath, filePath, callback)`\n\n[Verify](https://libsodium.gitbook.io/doc/public-key_cryptography/public-key_signatures#detached-mode) a file at `filePath` with a libsodium crypto_sign public key located at `publicPath` and detached  libsodium hex `signature`.\n\nCallback is called with `(err, valid)` where `valid` is a boolean indicating if the file is valid for the signature, public key and file combination.\n\n## See also\n\n- [sodium-native](https://github.com/sodium-friends/sodium-native): the underlying bindings to libsodium used perform all cryptographic actions.\n- [libsodium](https://download.libsodium.org/doc): docs for the libsodium library.\n\n## License\n\n[MIT](https://tldrlegal.com/license/mit-license)\n\n[npm-img]: https://img.shields.io/npm/v/sodium-cli.svg\n[npm]: https://npmjs.org/package/sodium-cli\n[travis-img]: https://travis-ci.com/bcomnes/sodium-cli.svg?token=MHQzYeFDHxgr3Y1iiUoN\u0026branch=master\n[travis]: https://travis-ci.com/bcomnes/sodium-cli\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcomnes%2Fsodium-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcomnes%2Fsodium-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcomnes%2Fsodium-cli/lists"}