{"id":22196922,"url":"https://github.com/valtech-commerce/tweetnacl","last_synced_at":"2026-05-10T16:37:46.316Z","repository":{"id":65724365,"uuid":"598214434","full_name":"valtech-commerce/tweetnacl","owner":"valtech-commerce","description":"TweetNaCl wrapper","archived":false,"fork":false,"pushed_at":"2023-02-06T17:27:32.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T17:03:10.533Z","etag":null,"topics":["nacl","npm-package","secretbox","tweetnacl"],"latest_commit_sha":null,"homepage":"","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/valtech-commerce.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":"2023-02-06T16:36:09.000Z","updated_at":"2023-02-06T17:26:58.000Z","dependencies_parsed_at":"2023-02-19T10:20:23.974Z","dependency_job_id":null,"html_url":"https://github.com/valtech-commerce/tweetnacl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/valtech-commerce/tweetnacl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtech-commerce%2Ftweetnacl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtech-commerce%2Ftweetnacl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtech-commerce%2Ftweetnacl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtech-commerce%2Ftweetnacl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valtech-commerce","download_url":"https://codeload.github.com/valtech-commerce/tweetnacl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtech-commerce%2Ftweetnacl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32864082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"ssl_error","status_checked_at":"2026-05-10T13:40:02.145Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["nacl","npm-package","secretbox","tweetnacl"],"created_at":"2024-12-02T14:17:30.282Z","updated_at":"2026-05-10T16:37:46.280Z","avatar_url":"https://github.com/valtech-commerce.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @valtech-commerce/tweetnacl\n\n[![npm](https://img.shields.io/npm/v/@valtech-commerce/tweetnacl.svg)](https://www.npmjs.com/package/@valtech-commerce/tweetnacl)\n[![npm dependencies](https://david-dm.org/valtech-commerce/tweetnacl-js/status.svg)](https://david-dm.org/valtech-commerce/tweetnacl-js)\n[![npms](https://badges.npms.io/%40valtech-commerce%2Ftweetnacl.svg)](https://npms.io/search?q=%40valtech-commerce%2Ftweetnacl)\n[![Travis CI](https://travis-ci.com/valtech-commerce/tweetnacl-js.svg?branch=master)](https://travis-ci.com/valtech-commerce/tweetnacl-js/builds)\n[![Code style ESLint](https://img.shields.io/badge/code_style-@valtech-commerce/library-659d32.svg)](https://github.com/valtech-commerce/eslint-config)\n\n\n\u003e [TweetNaCl](https://tweetnacl.js.org) wrapper\n\nWrap TweetNaCl functionalities\n\n\n## Install\n\n```shell\n$ npm install @valtech-commerce/tweetnacl\n```\n\n\n## Usage\n\n```js\n// Node.js\nconst tweetnacl = require('@valtech-commerce/tweetnacl');\n\n// Browser\n//   Load TweetNaCl libraries\n//   - /node_modules/tweetnacl/nacl-fast.js\n//   - /node_modules/tweetnacl-util/nacl-util.js\nconst { tweetnacl } = window.kafe;\n\n\n// Lock the box\nconst { box, key } = tweetnacl.secretbox.lock('Dirty little secret');\nconsole.log({ box, key });\n\n// Outputs:\n// {\n//   box: \"ThyOjmYtUvWSGne8lxXK7sJWGc/oigJ+I51pauSN/xTLpoufdAVNcCCQmtnwHlsu/hD7xnNZr7snkW4=\"\n//   key: \"ri4kzZ4V1pMGhGLqeqQayT3m2yT8FY79e1snqp2UAFg=\"\n// }\n\n\n// Unlock the box\nconst message = tweetnacl.secretbox.unlock(box, key);\nconsole.log(message);\n\n// Outputs:\n// Dirty little secret\n```\n\n\n\u003cbr\u003e\n\n## API\n\n### secretbox.lock(message)\nWraps [`nacl.secretbox`](https://github.com/dchest/tweetnacl-js/blob/master/README.md#naclsecretboxmessage-nonce-key) with autogeneration of `nonce` and `key`\u003cbr\u003e\nReturns an `Object` with `String` properties of `box` and `key`\n\n#### message\n*Required*\u003cbr\u003e\nType: `String`\u003cbr\u003e\nMessage to lock\n\n\n\n\u003cbr\u003e\n\n### secretbox.unlock(box, key)\nWraps [`nacl.secretbox.open`](https://github.com/dchest/tweetnacl-js/blob/master/README.md#naclsecretboxopenbox-nonce-key) with autoextraction of `nonce` from box\u003cbr\u003e\nReturns a `String` message\n\n#### box\n*Required*\u003cbr\u003e\nType: `String`\u003cbr\u003e\nBox containing encrypted message and nonce\n\n#### key\n*Required*\u003cbr\u003e\nType: `String`\u003cbr\u003e\nKey to unlock box\n\n\n\n\n\n\u003cbr\u003e\u003cbr\u003e\n\n## License\nMIT © [Valtech Canada inc.](https://www.valtech.ca/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaltech-commerce%2Ftweetnacl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaltech-commerce%2Ftweetnacl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaltech-commerce%2Ftweetnacl/lists"}