{"_id":"@apeleghq/rfc8188","_rev":"3-7a523d4a9339e0b1ee72c3b974f80a72","name":"@apeleghq/rfc8188","dist-tags":{"latest":"1.0.9"},"versions":{"1.0.7":{"name":"@apeleghq/rfc8188","version":"1.0.7","keywords":["encrypted content encoding","encrypted-content-encoding","rfc8188","aes128gcm"],"author":{"name":"Apeleg Limited"},"license":"ISC","_id":"@apeleghq/rfc8188@1.0.7","maintainers":[{"name":"er-ci-bot","email":"npmjs.com+er-ci-bot+fd8b22b478b6fac7@apeleg.com"},{"name":"corrideat","email":"3857362+corrideat@users.noreply.github.com"}],"homepage":"https://github.com/ApelegHQ/ts-rfc8188#readme","bugs":{"url":"https://github.com/ApelegHQ/ts-rfc8188/issues"},"dist":{"shasum":"d48ad235a2d8ce0ec56ee2d8998b2fd1ab173835","tarball":"https://registry.npmjs.org/@apeleghq/rfc8188/-/rfc8188-1.0.7.tgz","fileCount":41,"integrity":"sha512-EU2BkjaDwPqF9eVVi4N98bBivR9lTPqHbxiTmIMrw8WKS7KpZ93giWOQSrWUxRzy26zhNgkWAQW6JZUG2F5SOg==","signatures":[{"sig":"MEQCICf78HDBsF32vm9pZtdy9h/dL02PItlGPf9+HJPIEsnXAiBNLFqrUq/KmUoofKUAXkCht4EdcYXcL+y5rDltS4dK9A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apeleghq%2frfc8188@1.0.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":43037},"main":"dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./decrypt":{"import":{"types":"./dist/exports/decrypt.d.ts","default":"./dist/decrypt.mjs"},"require":{"types":"./dist/exports/decrypt.d.cts","default":"./dist/decrypt.cjs"}},"./encrypt":{"import":{"types":"./dist/exports/encrypt.d.ts","default":"./dist/encrypt.mjs"},"require":{"types":"./dist/exports/encrypt.d.cts","default":"./dist/encrypt.cjs"}},"./encodings":{"import":{"types":"./dist/exports/encodings.d.ts","default":"./dist/encodings.mjs"},"require":{"types":"./dist/exports/encodings.d.cts","default":"./dist/encodings.cjs"}}},"gitHead":"0b4812bfcc13e189c6bee5a03442db0fe68844e1","scripts":{"lint":"eslint . --ext .js,.jsx,.ts,.tsx","test":"node --loader ts-node/esm test/index.test.ts","build":"tsc --emitDeclarationOnly --declarationMap --declaration && node esbuild.mjs","prepack":"npm run build","version":"npm run lint && git add -A src","lint:fix":"eslint . --ext .js,.jsx,.ts,.tsx --fix","preversion":"npm run lint","postversion":"git push && git push --tags","prepublishOnly":"npm test && npm run lint"},"_npmUser":{"name":"er-ci-bot","email":"npmjs.com+er-ci-bot+fd8b22b478b6fac7@apeleg.com"},"repository":{"url":"git+https://github.com/ApelegHQ/ts-rfc8188.git","type":"git"},"_npmVersion":"10.8.2","description":"An implementation of RFC 8188 (encrypted content-encoding for HTTP)","directories":{},"_nodeVersion":"20.17.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","esbuild":"^0.23.1","ts-node":"^10.9.2","prettier":"^3.3.3","typescript":"^5.6.2","@types/node":"^22.5.4","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","@typescript-eslint/parser":"^8.5.0","@typescript-eslint/eslint-plugin":"^8.5.0"},"_npmOperationalInternal":{"tmp":"tmp/rfc8188_1.0.7_1726074557189_0.5487058450339899","host":"s3://npm-registry-packages"}},"1.0.8":{"name":"@apeleghq/rfc8188","version":"1.0.8","keywords":["encrypted content encoding","encrypted-content-encoding","rfc8188","aes128gcm"],"author":{"name":"Apeleg Limited"},"license":"ISC","_id":"@apeleghq/rfc8188@1.0.8","maintainers":[{"name":"er-ci-bot","email":"npmjs.com+er-ci-bot+fd8b22b478b6fac7@apeleg.com"},{"name":"corrideat","email":"3857362+corrideat@users.noreply.github.com"}],"homepage":"https://github.com/ApelegHQ/ts-rfc8188#readme","bugs":{"url":"https://github.com/ApelegHQ/ts-rfc8188/issues"},"dist":{"shasum":"f34299ac4a11e0b7e4dc54ebc7e2c7f7e7ac7b44","tarball":"https://registry.npmjs.org/@apeleghq/rfc8188/-/rfc8188-1.0.8.tgz","fileCount":41,"integrity":"sha512-IK0IJnhgiyf+/BGuGFxGh5an8i9CiM9m9fmVlHOi18y/CibUeeugnbVDwOl7HFlbtmU0ofL6fHccUelLhGcxQg==","signatures":[{"sig":"MEUCIQD/z94DqFV+SPQVU/eqjqpYeDAWZzFV9BHAXf1kruvfZQIgE/7eL1cNectg+R1/ePT1Yl7/pLyZIKZLgrhE6ncXa5Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apeleghq%2frfc8188@1.0.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":43262},"main":"dist/index.cjs","type":"module","types":"dist/index.d.cts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./decrypt":{"import":{"types":"./dist/exports/decrypt.d.ts","default":"./dist/decrypt.mjs"},"require":{"types":"./dist/exports/decrypt.d.cts","default":"./dist/decrypt.cjs"}},"./encrypt":{"import":{"types":"./dist/exports/encrypt.d.ts","default":"./dist/encrypt.mjs"},"require":{"types":"./dist/exports/encrypt.d.cts","default":"./dist/encrypt.cjs"}},"./encodings":{"import":{"types":"./dist/exports/encodings.d.ts","default":"./dist/encodings.mjs"},"require":{"types":"./dist/exports/encodings.d.cts","default":"./dist/encodings.cjs"}}},"gitHead":"f374817e2a1b5b5e464d40950d10c6f102829497","scripts":{"lint":"eslint . --ext .js,.jsx,.ts,.tsx","test":"node --import ./loader.mjs --test test/index.test.ts","build":"tsc --emitDeclarationOnly --declarationMap --declaration && node --import ./loader.mjs esbuild.ts","prepack":"npm run build","version":"npm run lint && git add -A src","lint:fix":"eslint . --ext .js,.jsx,.ts,.tsx --fix","preversion":"npm run lint","postversion":"git push && git push --tags","prepublishOnly":"npm test && npm run lint"},"_npmUser":{"name":"er-ci-bot","email":"npmjs.com+er-ci-bot+fd8b22b478b6fac7@apeleg.com"},"repository":{"url":"git+https://github.com/ApelegHQ/ts-rfc8188.git","type":"git"},"_npmVersion":"10.8.2","description":"An implementation of RFC 8188 (encrypted content-encoding for HTTP)","directories":{},"_nodeVersion":"20.19.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.23.0","esbuild":"^0.25.1","globals":"^16.0.0","ts-node":"^10.9.2","prettier":"^3.5.3","@eslint/js":"^9.23.0","typescript":"^5.8.2","@types/node":"^22.13.11","@eslint/eslintrc":"^3.3.1","eslint-config-prettier":"^10.1.1","eslint-plugin-prettier":"^5.2.3","@typescript-eslint/parser":"^8.27.0","@typescript-eslint/eslint-plugin":"^8.27.0"},"_npmOperationalInternal":{"tmp":"tmp/rfc8188_1.0.8_1742789719699_0.6399857741001551","host":"s3://npm-registry-packages-npm-production"}},"1.0.9":{"name":"@apeleghq/rfc8188","version":"1.0.9","description":"An implementation of RFC 8188 (encrypted content-encoding for HTTP)","type":"module","main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.cts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./decrypt":{"import":{"types":"./dist/exports/decrypt.d.ts","default":"./dist/decrypt.mjs"},"require":{"types":"./dist/exports/decrypt.d.cts","default":"./dist/decrypt.cjs"}},"./encodings":{"import":{"types":"./dist/exports/encodings.d.ts","default":"./dist/encodings.mjs"},"require":{"types":"./dist/exports/encodings.d.cts","default":"./dist/encodings.cjs"}},"./encrypt":{"import":{"types":"./dist/exports/encrypt.d.ts","default":"./dist/encrypt.mjs"},"require":{"types":"./dist/exports/encrypt.d.cts","default":"./dist/encrypt.cjs"}}},"devDependencies":{"@eslint/eslintrc":"^3.3.1","@eslint/js":"^9.37.0","@types/node":"^24.7.2","@typescript-eslint/eslint-plugin":"^8.46.0","@typescript-eslint/parser":"^8.46.0","esbuild":"^0.25.10","eslint":"^9.37.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","globals":"^16.4.0","prettier":"^3.6.2","ts-node":"^10.9.2","typescript":"^5.9.3"},"repository":{"type":"git","url":"git+https://github.com/ApelegHQ/ts-rfc8188.git"},"scripts":{"lint":"eslint . --ext .js,.jsx,.ts,.tsx","lint:fix":"eslint . --ext .js,.jsx,.ts,.tsx --fix","build":"tsc --emitDeclarationOnly --declarationMap --declaration && node --import ./loader.mjs esbuild.ts","test":"node --import ./loader.mjs --test test/index.test.ts","prepack":"npm run build","prepublishOnly":"npm test && npm run lint","preversion":"npm run lint","version":"npm run lint && git add -A src","postversion":"git push && git push --tags"},"author":{"name":"Apeleg Limited"},"license":"ISC","keywords":["encrypted content encoding","encrypted-content-encoding","rfc8188","aes128gcm"],"_id":"@apeleghq/rfc8188@1.0.9","gitHead":"334862df0ea9934335760f61c2341757ad8a294f","bugs":{"url":"https://github.com/ApelegHQ/ts-rfc8188/issues"},"homepage":"https://github.com/ApelegHQ/ts-rfc8188#readme","_nodeVersion":"24.9.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-rblgRtMDQBzPpHTtR77/QdY+6VsXVlLob6DObfPYJ7G3AIxr2b/qb6mi5eUgPYkqsiCb95NF9IH71+k6MmgQFw==","shasum":"7e160ea7ef19ebb8d30b271827c03e1cb1ff9afb","tarball":"https://registry.npmjs.org/@apeleghq/rfc8188/-/rfc8188-1.0.9.tgz","fileCount":41,"unpackedSize":44594,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apeleghq%2frfc8188@1.0.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCz8ofWq4TBuKEp2yYCL4vAvbDzdmuxk1OZpY+RJQwmQQIhANfpnQNv/SzIW7X5UvSrRGRdUCHhBm8AL79ZJp4WYUzT"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3cf2af45-7e0f-4925-8e6a-0cca86fd8202"}},"directories":{},"maintainers":[{"name":"er-ci-bot","email":"npmjs.com+er-ci-bot+fd8b22b478b6fac7@apeleg.com"},{"name":"corrideat","email":"3857362+corrideat@users.noreply.github.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rfc8188_1.0.9_1760198591218_0.6032988335288432"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-11T17:09:17.110Z","modified":"2025-10-11T16:03:11.829Z","1.0.7":"2024-09-11T17:09:17.370Z","1.0.8":"2025-03-24T04:15:19.953Z","1.0.9":"2025-10-11T16:03:11.409Z"},"bugs":{"url":"https://github.com/ApelegHQ/ts-rfc8188/issues"},"author":{"name":"Apeleg Limited"},"license":"ISC","homepage":"https://github.com/ApelegHQ/ts-rfc8188#readme","keywords":["encrypted content encoding","encrypted-content-encoding","rfc8188","aes128gcm"],"repository":{"type":"git","url":"git+https://github.com/ApelegHQ/ts-rfc8188.git"},"description":"An implementation of RFC 8188 (encrypted content-encoding for HTTP)","maintainers":[{"name":"er-ci-bot","email":"npmjs.com+er-ci-bot+fd8b22b478b6fac7@apeleg.com"},{"name":"corrideat","email":"3857362+corrideat@users.noreply.github.com"}],"readme":"🔒 **RFC 8188 Encrypted Content-Encoding for HTTP in TypeScript**\r\n\r\n [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Exact-Realty_ts-rfc8188&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=Exact-Realty_ts-rfc8188)\r\n [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Exact-Realty_ts-rfc8188&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=Exact-Realty_ts-rfc8188)\r\n [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Exact-Realty_ts-rfc8188&metric=bugs)](https://sonarcloud.io/summary/new_code?id=Exact-Realty_ts-rfc8188)\r\n [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Exact-Realty_ts-rfc8188&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=Exact-Realty_ts-rfc8188)\r\n [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Exact-Realty_ts-rfc8188&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Exact-Realty_ts-rfc8188)\r\n ![NPM Downloads](https://img.shields.io/npm/dw/@apeleghq/rfc8188?style=flat-square)\r\n\r\n\r\n---\r\n### 🚀 Features\r\n\r\n- Implements RFC 8188 for encrypted content-encoding in HTTP.\r\n- Supports AES-128-GCM encryption algorithm.\r\n- Additionally, supports AES-256-GCM encryption algorithm _(non-standard)_.\r\n- Provides functions for both encryption and decryption of data.\r\n- Flexible configuration options for encoding parameters.\r\n\r\n### 💻 Installation\r\n\r\nTo install the package, you can use npm or yarn:\r\n\r\n```sh\r\nnpm install @apeleghq/rfc8188\r\n```\r\n\r\nor\r\n\r\n```sh\r\nyarn add @apeleghq/rfc8188\r\n```\r\n\r\n### 📚 Usage\r\n\r\n#### Decrypting Data\r\n\r\n```javascript\r\nimport { encodings, decrypt } from '@apeleghq/rfc8188';\r\n\r\n// Maximum permissible record size when decrypting. Because the decrypted data\r\n// are buffered until a record is full, not limiting it can result in a very\r\n// large memory allocation (4 GiB) depending on the incoming data.\r\n// If this parameter is not provided, no limit is used. Otherwise, incoming data\r\n// claiming to have records larger than this value will be rejected with.\r\nconst maxRecordSize = Infinity;\r\n\r\n// Provide a function to lookup Initial Keying Material (IKM)\r\nconst lookupIKM = async (keyId) => {\r\n  // Your logic to lookup IKM\r\n  return new ArrayBuffer(16);\r\n};\r\n\r\n// Your readable stream with ciphertext\r\nconst dataStreamToDecrypt = new ReadableStream();\r\n\r\n// Decrypt data\r\nconst decryptedDataSteam = decrypt(\r\n    encodings.aes128gcm,\r\n    dataStreamToDecrypt,\r\n    lookupIKM,\r\n    maxRecordSize, // optional\r\n);\r\n\r\n// Handle decrypted data stream\r\n// ...\r\n```\r\n\r\n#### Encrypting Data\r\n\r\n```javascript\r\nimport { encodings, encrypt } from '@apeleghq/rfc8188';\r\n\r\n// Your readable stream with plaintext\r\nconst dataStreamToEncrypt = new ReadableStream();\r\n// Some record size. It must be a value between 18 and 2**32 - 1 and is used\r\n// for chunking.\r\nconst recordSize = 512;\r\n// A key ID to be included in the payload header.\r\n// It must be between 0 and 255 bytes long and is used to identify the IKM used.\r\nconst keyId = new ArrayBuffer(0);\r\n// Initial Keying Material (IKM). Used to derive an encryption key. Note: this\r\n// value is **not** output and it must be treated as a secret.\r\nconst IKM = new ArrayBuffer(0);\r\n// Optional. A salt value, which will be combined with the IKM to derive an\r\n// encyption key. If none is provided, a randomly-generated salt value will be\r\n// used. Note that the salt must be exactly 16 bytes long.\r\nconst salt = new ArrayBuffer(16);\r\n\r\n// Provide plaintext data and encryption parameters\r\nconst encryptedDataStream = await encrypt(\r\n    encodings.aes128gcm,\r\n    dataStreamToEncrypt,\r\n    recordSize,\r\n    keyId,\r\n    IKM,\r\n    salt, // optional\r\n);\r\n\r\n// Handle encrypted data stream\r\n// ...\r\n```\r\n\r\n### 🤝 Contributing\r\n\r\nWe welcome any contributions and feedback! Please feel free to submit pull\r\nrequests, bug reports or feature requests to our GitHub repository.\r\n\r\n### 📜 License\r\n\r\nThis project is released under the ISC license. Check out the `LICENSE` file for\r\nmore information.\r\n","readmeFilename":"README.md"}