{"id":19555485,"url":"https://github.com/maxzz/ts-sjcl","last_synced_at":"2025-06-11T07:09:39.830Z","repository":{"id":174542344,"uuid":"652381773","full_name":"maxzz/ts-sjcl","owner":"maxzz","description":"Stanford Javascript Crypto Library updated to ES6","archived":false,"fork":false,"pushed_at":"2024-04-20T19:55:09.000Z","size":191,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-04T06:15:24.271Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-06-12T00:34:46.000Z","updated_at":"2024-04-20T19:55:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"49497ac2-1b2e-4754-b368-1b552bc48ead","html_url":"https://github.com/maxzz/ts-sjcl","commit_stats":null,"previous_names":["maxzz/ts-sjcl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxzz%2Fts-sjcl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxzz%2Fts-sjcl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxzz%2Fts-sjcl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxzz%2Fts-sjcl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxzz","download_url":"https://codeload.github.com/maxzz/ts-sjcl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxzz%2Fts-sjcl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259219697,"owners_count":22823576,"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":[],"created_at":"2024-11-11T04:34:14.948Z","updated_at":"2025-06-11T07:09:39.787Z","avatar_url":"https://github.com/maxzz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sjcl-ts\r\n\r\nStanford Javascript Crypto Library updated to ES6.\r\n\r\n\u003e Tiny 2.72kB AES-GCM library\r\n\r\n- **Tiny**: about 2.72kB after gzipped\r\n- **Mordern**: pure ESM package\r\n- **Reliable**: based on [Stanford Javascript Crypto Library](https://github.com/bitwiseshiftleft/sjcl) with minimal customization\r\n\r\n## Installation\r\n\r\n```sh\r\npnpm add ts-sjcl\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nimport sjcl from 'ts-sjcl'\r\n\r\nconst password = sjcl.codec.utf8String.toBits('PASSWORD')\r\nconst iv = sjcl.codec.utf8String.toBits('IV')\r\n\r\nconst cipher = new sjcl.cipher.aes(password)\r\n\r\nexport function encrypt(plaintext) {\r\n  return sjcl.codec.base64.fromBits(\r\n    sjcl.mode.gcm.encrypt(cipher, sjcl.codec.utf8String.toBits(plaintext), iv)\r\n  )\r\n}\r\n\r\nexport function decrypt(ciphertext) {\r\n  return sjcl.codec.utf8String.fromBits(\r\n    sjcl.mode.gcm.decrypt(cipher, sjcl.codec.base64.toBits(ciphertext), iv)\r\n  )\r\n}\r\n\r\nconsole.log(encrypt('Hello World!'))\r\nconsole.log(decrypt('0sFJ9r7c33z7gB4u1pD0xzuX48xaYVBGLj41UQ=='))\r\n```\r\n\r\n## Documentation\r\n\r\n[https://bitwiseshiftleft.github.io/sjcl/doc](https://bitwiseshiftleft.github.io/sjcl/doc)\r\n\r\n## Credits, refs, links\r\n\r\n* [bitwiseshiftleft/sjcl](https://github.com/bitwiseshiftleft/sjcl) (6 years old, [@types](https://www.npmjs.com/package/@types/sjcl), [types](https://github.com/Evgenus/sjcl-typescript-definitions))\r\n* [liufei/sjcl-es](https://github.com/liufei/sjcl-es) (ESM, no typescript definitions)\r\n\r\n* [peterolson/BigInteger](https://github.com/peterolson/BigInteger.js)\r\n* [alibaba-archive/node-biginteger](https://github.com/alibaba-archive/node-biginteger/blob/master/lib/BigInteger.js)\r\n* [dasavrasov/SrpClientJS: biginteger.js](https://github.com/dasavrasov/SrpClientJS/blob/master/srp-client/src/srp/biginteger.js)\r\n* [GH: 'BigInteger bnGetLowestSetBit'](https://github.com/search?q=BigInteger+bnGetLowestSetBit\u0026type=code\u0026ref=advsearch)\r\n  * [travist/jsencrypt: jsbn.ts](https://github.com/travist/jsencrypt/blob/master/src/lib/jsbn/jsbn.ts)\r\n  * [travist/jsencrypt: rng.ts](https://github.com/travist/jsencrypt/blob/master/src/lib/jsbn/rng.ts)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxzz%2Fts-sjcl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxzz%2Fts-sjcl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxzz%2Fts-sjcl/lists"}