{"_id":"sjcl-es","_rev":"4-d3685ea40791266077ff97cbf41d0123","time":{"1.0.9":"2021-11-06T11:28:15.552Z","created":"2021-11-08T14:01:43.994Z","2.0.0":"2021-11-08T14:01:44.203Z","modified":"2022-05-18T00:16:08.312Z"},"name":"sjcl-es","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0":{"name":"sjcl-es","version":"2.0.0","description":"Tiny 2.72kB AES-GCM library","type":"module","module":"./sjcl.js","exports":"./sjcl.js","author":{"name":"bitwiseshiftleft"},"license":"(BSD-2-Clause OR GPL-2.0-only)","homepage":"https://github.com/liufei/sjcl-es","keywords":["encryption","high-level","crypto","tiny","aes","gcm"],"repository":{"type":"git","url":"git+https://github.com/liufei/sjcl-es.git"},"scripts":{"test":"make test","jsdoc":"jsdoc -c jsdoc.conf.json","lint":"eslint . || true"},"browser":{"crypto":false},"engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"devDependencies":{"eslint":"^2.11.1","jsdoc":"3.4.0"},"gitHead":"4b06ce17a8369463aeccfed10bc5a63bb1c64225","bugs":{"url":"https://github.com/liufei/sjcl-es/issues"},"_id":"sjcl-es@2.0.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-P8O+4pAt95XqmTlvvPdbmBggjAgSE0LQnhSEYUKYKepN176b/8K9zcVrrqhuLu5EUQyeCYy/56J9FzxvzvMavg==","shasum":"23030ca2eda9e324bbaf27f6b86221d37431144d","tarball":"https://registry.npmjs.org/sjcl-es/-/sjcl-es-2.0.0.tgz","fileCount":129,"unpackedSize":2265130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh27RHCRA9TVsSAnZWagAAVxsP/22jVymvc5GRW6jNNuyO\n6xfYAZ9SOTFJkxwI8Nq37M/300wFuXsBijLea2bGbarE9c3Ri1bGCgAjN8u4\nThP5s1ep10PfhA5d+KIvmX9ldmlay6aVhlEbnJTMxm9ioyNfgFrjfZ1laGS5\nn+P/kXpQvVlhdNjE9CEP1WlhlEE6Flv/+H9Cxor4VW8Bn3sSqaQvIL7HE69b\nACiW2xM+IrfxBrQT+AoAuPBwMrphsOGyfgHCeh3TrHps0MnCHSC0oGq5ENuM\n4ZJ1f4ikgVz0sLzvlPMdE5iBtX/wti0JNIG7sKYCwvoG9usi/6K7wMhL3YdR\nDCYVc0bNheIT6SuwZbgWKyo/Bo3fQbmnYY9ahhoeXAin47tBbEN8F0PfHxm3\nQs+lPvt2EUxq8VDaECL0WnKVGOK5ZEQFvXUj+5jag9/9VsTLBmqAmyJmQCk/\nCeiaipedBXdJ1UnOf4c0GEuB3/+0IWpuNSagoRt2/BV26La9eq9hzKa0zqD0\nYiypKoG0vsrUAN5gAuIgpOk8RsMktZjI33IWJVfJFhTwNVVSCxDfGaOPusD7\nBHFyasFxANB42piYS9hpajvChJJoolz9VTi96bKC/iw6+s6LamhZnE9Zu47C\ngPWC3C/by+8tHhy9TYqTUVl72Gp67MKOPwOp2Il1HPG2eV2CLtYaEPEeCWW5\nqeS/\r\n=BMpB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDO3z4hR+5AKxGHwRreLLW2S0D6KTKEScfKmk37/SAP2AIhAKT70/beYPtqsBQeTk0OHSiXv/huCWsJ0qpomx46FZzj"}]},"_npmUser":{"name":"biped","email":"poticr@gmail.com"},"directories":{},"maintainers":[{"name":"biped","email":"poticr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sjcl-es_2.0.0_1636380103995_0.4036643215779585"},"_hasShrinkwrap":false}},"maintainers":[{"name":"biped","email":"poticr@gmail.com"}],"description":"Tiny 2.72kB AES-GCM library","homepage":"https://github.com/liufei/sjcl-es","keywords":["encryption","high-level","crypto","tiny","aes","gcm"],"repository":{"type":"git","url":"git+https://github.com/liufei/sjcl-es.git"},"author":{"name":"bitwiseshiftleft"},"bugs":{"url":"https://github.com/liufei/sjcl-es/issues"},"license":"(BSD-2-Clause OR GPL-2.0-only)","readme":"# sjcl-es\n\n> Tiny 2.72kB AES-GCM library\n\n- **Tiny**: about 2.72kB after gzipped\n- **Mordern**: pure ESM package\n- **Reliable**: based on [Stanford Javascript Crypto Library](https://github.com/bitwiseshiftleft/sjcl) with minimal customization\n\n## Installation\n\n```sh\npnpm add sjcl-es\n```\n\n## Usage\n\n```js\nimport sjcl from 'sjcl-es'\n\nconst password = sjcl.codec.utf8String.toBits('PASSWORD')\nconst iv = sjcl.codec.utf8String.toBits('IV')\n\nconst cipher = new sjcl.cipher.aes(password)\n\nexport function encrypt(plaintext) {\n  return sjcl.codec.base64.fromBits(\n    sjcl.mode.gcm.encrypt(cipher, sjcl.codec.utf8String.toBits(plaintext), iv)\n  )\n}\n\nexport function decrypt(ciphertext) {\n  return sjcl.codec.utf8String.fromBits(\n    sjcl.mode.gcm.decrypt(cipher, sjcl.codec.base64.toBits(ciphertext), iv)\n  )\n}\n\nconsole.log(encrypt('Hello World!'))\nconsole.log(decrypt('0sFJ9r7c33z7gB4u1pD0xzuX48xaYVBGLj41UQ=='))\n```\n\n## Documentation\n\n[https://bitwiseshiftleft.github.io/sjcl/doc/](https://bitwiseshiftleft.github.io/sjcl/doc/)\n","readmeFilename":"README.md"}