{"_id":"node-scr","_rev":"9-78a2efbdbd669bbd5240472d29d8471e","name":"node-scr","description":"JavaScript library to work with Secure Content Resource (SCR) objects","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"node-scr","version":"0.2.0","description":"JavaScript library to work with Secure Content Resource (SCR) objects","main":"./lib/index.js","scripts":{"test":"gulp test:nodejs"},"repository":{"type":"git","url":"git+ssh://git@github.com/cisco/node-scr.git"},"keywords":["scr","crypto","jose"],"author":{"name":"Cisco Systems, Inc.","email":"https://www.cisco.com"},"contributors":[{"name":"Matthew A. Miller","email":"linuxwolf@outer-planes.net"}],"license":"Apache-2.0","dependencies":{"es6-promise":"^2.0.1","lodash.clone":"^3.0.2","node-jose":"^0.3.0"},"devDependencies":{"browserify":"^8.1.3","chai":"^1.10.0","del":"^1.1.1","gulp":"^3.8.10","gulp-doctoc":"^0.1.2","gulp-eslint":"^0.5.0","gulp-istanbul":"^0.6.0","gulp-mocha":"^2.0.0","gulp-rename":"^1.2.0","gulp-sourcemaps":"^1.3.0","gulp-uglify":"^1.1.0","istanbul":"^0.3.5","karma":"^0.12.31","karma-browserify":"^3.0.1","karma-chrome-launcher":"^0.1.7","karma-firefox-launcher":"^0.1.4","karma-mocha":"^0.1.10","karma-mocha-reporter":"^0.3.1","karma-safari-launcher":"^0.1.1","karma-sauce-launcher":"^0.2.14","lodash.merge":"^3.3.1","mocha":"^2.1.0","run-sequence":"^1.0.2","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.0.0","yargs":"^3.18.0"},"gitHead":"2b618f7ae808c89b9e8aaa1c75d84cdc9621c16f","bugs":{"url":"https://github.com/cisco/node-scr/issues"},"homepage":"https://github.com/cisco/node-scr#readme","_id":"node-scr@0.2.0","_shasum":"523033493009a950a05fda507ceb97d5635f98a6","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"linuxwolf","email":"linuxwolf@outer-planes.net"},"dist":{"shasum":"523033493009a950a05fda507ceb97d5635f98a6","tarball":"https://registry.npmjs.org/node-scr/-/node-scr-0.2.0.tgz","integrity":"sha512-rzoU+wKRVPS837wxl8rU4ObnIQybiIVo9lDXkSMP4jOCKEO4bc9Ix35tjCtwfy4lD+UYTiSXwtaNwvsy3PEhWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCanzM/joqVjSb3ImI9FKwCjviH1ejHAu58rGsy1DvNjgIgZyikjppWBADUjmvmMof+hJ0F29s2+ySrTCZFklmCrdc="}]},"maintainers":[{"name":"linuxwolf","email":"linuxwolf@outer-planes.net"}],"directories":{}},"0.2.1":{"name":"node-scr","version":"0.2.1","description":"JavaScript library to work with Secure Content Resource (SCR) objects","main":"./lib/index.js","scripts":{"test":"gulp test:nodejs"},"repository":{"type":"git","url":"git+ssh://git@github.com/cisco/node-scr.git"},"keywords":["scr","crypto","jose"],"author":{"name":"Cisco Systems, Inc.","email":"https://www.cisco.com"},"contributors":[{"name":"Matthew A. Miller","email":"linuxwolf@outer-planes.net"}],"license":"Apache-2.0","dependencies":{"es6-promise":"^2.0.1","lodash.clone":"^3.0.2","node-jose":">=0.3.0 <1.0"},"devDependencies":{"browserify":"^8.1.3","chai":"^1.10.0","del":"^1.1.1","gulp":"^3.8.10","gulp-doctoc":"^0.1.2","gulp-eslint":"^0.5.0","gulp-istanbul":"^0.6.0","gulp-mocha":"^2.0.0","gulp-rename":"^1.2.0","gulp-sourcemaps":"^1.3.0","gulp-uglify":"^1.1.0","istanbul":"^0.3.5","karma":"^0.12.31","karma-browserify":"^3.0.1","karma-chrome-launcher":"^0.1.7","karma-firefox-launcher":"^0.1.4","karma-mocha":"^0.1.10","karma-mocha-reporter":"^0.3.1","karma-safari-launcher":"^0.1.1","karma-sauce-launcher":"^0.2.14","lodash.merge":"^3.3.1","mocha":"^2.1.0","run-sequence":"^1.0.2","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.0.0","yargs":"^3.18.0"},"gitHead":"af29d5a425ac5c2416662f5a1bc20de1e132599f","bugs":{"url":"https://github.com/cisco/node-scr/issues"},"homepage":"https://github.com/cisco/node-scr#readme","_id":"node-scr@0.2.1","_shasum":"d77d2e1f52a6b873aec2a9e84b907aa32276b4c6","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.0","_npmUser":{"name":"linuxwolf","email":"linuxwolf@outer-planes.net"},"dist":{"shasum":"d77d2e1f52a6b873aec2a9e84b907aa32276b4c6","tarball":"https://registry.npmjs.org/node-scr/-/node-scr-0.2.1.tgz","integrity":"sha512-p1ArY2tleK23YXsAYDUqe0BSo291Poe6rhJWV/l4/siEv4eaR0P7sO6raqj63aO6flIQz4TXA+YCat+gLeSUwA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRsCcVzJZhcAMuGFuwxJIB8NC7rDb/r/AGTKUO+LOWcgIgFmtcMj8wKT4m1Wj9NMESBNcY7Am693O7QF4LZf/Ozpg="}]},"maintainers":[{"name":"linuxwolf","email":"linuxwolf@outer-planes.net"}],"directories":{}},"0.2.2":{"name":"node-scr","version":"0.2.2","description":"JavaScript library to work with Secure Content Resource (SCR) objects","main":"./lib/index.js","scripts":{"test":"gulp test:nodejs"},"repository":{"type":"git","url":"git+ssh://git@github.com/cisco/node-scr.git"},"keywords":["scr","crypto","jose"],"author":{"name":"Cisco Systems, Inc.","email":"https://www.cisco.com"},"contributors":[{"name":"Matthew A. Miller","email":"linuxwolf@outer-planes.net"}],"license":"Apache-2.0","dependencies":{"es6-promise":"^2.0.1","lodash.clone":"^3.0.2","node-jose":">=0.3.0 <1.0"},"devDependencies":{"chai":"^1.10.0","del":"^1.1.1","gulp":"^3.8.10","gulp-doctoc":"^0.1.2","gulp-eslint":"^0.5.0","gulp-istanbul":"^0.6.0","gulp-mocha":"^2.0.0","gulp-rename":"^1.2.0","gulp-uglify":"^1.1.0","istanbul":"^0.3.5","karma":"^1.2.0","karma-chrome-launcher":"^0.1.7","karma-firefox-launcher":"^0.1.4","karma-mocha":"^0.1.10","karma-mocha-reporter":"^0.3.1","karma-safari-launcher":"^0.1.1","karma-sauce-launcher":"^0.2.14","karma-webpack":"^1.8.0","lodash.merge":"^3.3.1","mocha":"^2.1.0","run-sequence":"^1.0.2","webpack":"^1.13.2","webpack-stream":"^3.2.0","yargs":"^3.18.0"},"gitHead":"5bfda68d14d05a64576982443711f0b8533ad8ec","bugs":{"url":"https://github.com/cisco/node-scr/issues"},"homepage":"https://github.com/cisco/node-scr#readme","_id":"node-scr@0.2.2","_shasum":"542aad742010d12e419b5906da516af9dea305da","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"linuxwolf","email":"linuxwolf@outer-planes.net"},"dist":{"shasum":"542aad742010d12e419b5906da516af9dea305da","tarball":"https://registry.npmjs.org/node-scr/-/node-scr-0.2.2.tgz","integrity":"sha512-dLLUGB/2F1x9OfNjxhyXfye0UF0y4rC0DOX01z9Fo055GwbC079uXe1H9q1JnyXbi7SCz9nCzHKtsw6cXCJiVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/A1NEB0juSV9APWezKyy1Uff7dOsF8rxXh+8OIZEMqAiA4XhKMtFVW2DZGeEbMxWlKuUlVP2DsTjoW6iyEhm5HeQ=="}]},"maintainers":[{"name":"linuxwolf","email":"linuxwolf@outer-planes.net"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/node-scr-0.2.2.tgz_1471972171302_0.8374988436698914"},"directories":{}},"0.3.0":{"name":"node-scr","version":"0.3.0","description":"JavaScript library to work with Secure Content Resource (SCR) objects","main":"./lib/index.js","scripts":{"test":"gulp test:nodejs"},"repository":{"type":"git","url":"git+ssh://git@github.com/cisco/node-scr.git"},"keywords":["scr","crypto","jose"],"author":{"name":"Cisco Systems, Inc.","email":"https://www.cisco.com"},"contributors":[{"name":"Matthew A. Miller","email":"linuxwolf@outer-planes.net"}],"license":"Apache-2.0","dependencies":{"es6-promise":"^2.0.1","lodash.clone":"^3.0.2","node-jose":"^2.0.0"},"devDependencies":{"chai":"^1.10.0","del":"^1.1.1","gulp":"^3.8.10","gulp-doctoc":"^0.1.2","gulp-eslint":"^0.5.0","gulp-istanbul":"^0.6.0","gulp-mocha":"^2.0.0","gulp-rename":"^1.2.0","gulp-uglify":"^1.1.0","istanbul":"^0.3.5","karma":"^1.2.0","karma-chrome-launcher":"^0.1.7","karma-firefox-launcher":"^0.1.4","karma-mocha":"^0.1.10","karma-mocha-reporter":"^0.3.1","karma-safari-launcher":"^0.1.1","karma-sauce-launcher":"^0.2.14","karma-webpack":"^1.8.0","lodash.merge":"^3.3.1","mocha":"^2.1.0","run-sequence":"^1.0.2","webpack":"^1.13.2","webpack-stream":"^3.2.0","yargs":"^3.18.0"},"gitHead":"a9ba29969e96fc686467534979fd5df3501e1b15","bugs":{"url":"https://github.com/cisco/node-scr/issues"},"homepage":"https://github.com/cisco/node-scr#readme","_id":"node-scr@0.3.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-Hb0ykojynSbt7ra6eml6NX39WAumFfU3G81XvLpp2H7y8KjQc29oEIf2TlgZQCfA+pyxbY5t4a1xBqPpyrbpvw==","shasum":"ad6094890993c886b24dbfde5c613277a334b569","tarball":"https://registry.npmjs.org/node-scr/-/node-scr-0.3.0.tgz","fileCount":7,"unpackedSize":24017,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkHIVCRA9TVsSAnZWagAAyCUP/2BzNvZkhSbasnfIkv20\nuazx5WplZrh6j+HDXazugWly5epvRgfWZ6xYS66c7YGvroYknBhhowLSeB1k\ngTI+JOCLzCd1yQU5WPDHI6T7TUoW6aNNLpGq5vekqT960GkYfkiXkX06nIoI\nyrNHMMSue6rr5GaBhDfDU4BxdQT5VLdzUIRiaa05UsjKaCxHKPFevwDiqThD\nfREp/vghLY8YhYmOo16INj4EXfKRvGN9hxONqrW88AU4+UJ7Hxz+VMPUOh+/\nny62hrZFP5XeWoyOBarrceuLL3YCb+MEWWBoZ0cvcXYvej8yzwk1p5ySYCLb\nU081DhVQdry++LbWDNy9cN4Ot/Oys3kv8vUxdu9OKkl/4nrKcM5NMHbS/5jQ\nBMblIQnrPO6HuIw5Fs2blKFBpD0riuqsPCYQ3jPlG7kauUKAdJ/QdA3D5SKF\nTKqOfqm5/aaaW3Ct0NZKX3zjYV4p6WHXgCNOn5zIF83ZFpppGYtxgeuHg4g4\nKu2PG8a8H2f/fsLtZaXsGbFGiUCI3H83KpuXYbd+UkkV1S4+ZfvSYRxum1IF\nvh0BwWCThmdFjGYryo7XLOVXPNCapQ5RL8jyXqkOg6o+V/sPn2L/tm2rqzPp\nz7oGWOH6YSf6TB5PtaNtR/sc7sJOJgR7XbBTHFpBZ23qAvZdj0CUmUzEVSsY\nxaPH\r\n=Yl9R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGa8x8XZjkFogFftPV+TDfQhZ8whjU2Ex6nh19fUpNLGAiEA+vbVrShORmhp2sKrBOOMo+YOzsKkJde5PRsWq4iS6PE="}]},"maintainers":[{"name":"linuxwolf","email":"linuxwolf@outer-planes.net"},{"name":"mwegman","email":"mwegman@cisco.com"}],"_npmUser":{"name":"linuxwolf","email":"linuxwolf@outer-planes.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-scr_0.3.0_1603301908593_0.42829863416469705"},"_hasShrinkwrap":false}},"readme":"# node-scr #\n\nA JavaScript implementation of Secure Content Resource (SCR) for current web browsers and node.js-based servers.  An SCR provides enough information to find and decrypt large protected content (e.g., shared file).\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n<a name='toc'>\n\n- [Installing](#installing)\n- [Basics](#basics)\n- [Creating](#creating)\n- [Dealing with Content](#dealing-with-content)\n- [Importing/Exporting as a JWE](#importingexporting-as-a-jwe)\n- [As JSON](#as-json)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n## Installing ##\n\nTo install the latest from [NPM](https://npmjs.com/):\n\n```\n  npm install node-scr\n```\n\nOr to install a specific release:\n\n```\n  npm install node-scr@0.2.0\n```\n\nAlternatively, the latest unpublished code can be installed directly from the repository:\n\n```\n  npm install git+ssh://git@github.com:cisco/node-scr.git\n```\n\n## Basics ##\n\nRequire the library as normal:\n\n```\nvar SCR = require(\"node-scr\");\n```\n\nThis library uses [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) for most operations.\n\nThis library supports [Browserify](http://browserify.org/).  To use in a web browser, `require('node-scr')` and bundle with the rest of your app.\n\nThe content to be encrypted or returned from being decrypted are [Buffer](https://nodejs.org/api/buffer.html) objects.\n\n## Creating ##\n\nTo create an empty SCR:\n\n```\nvar scrObject;\nSCR.create().\n    then(function(result) {\n      // {result} is a SRC object\n      scrObject = result;\n    });\n```\n\nThe SCR object has the following properties:\n\n* \"enc\" - The Content Encryption Algorithm (from [JWA](https://tools.ietf.org/html/rfc7518))\n* \"key\" - The raw content encryption key (as a 'node-jose' jose.JWK.Key object)\n* \"iv\" - The initialization vector (as a Buffer)\n* \"aad\" - The additional authenticated data (as a String)\n* \"loc\" - The location (usually a URI) where the encrypted content is published\n* \"tag\" - The authentication tag (as a Buffer)\n\n`SCR.create()` populates the cryptographic input factors (key, IV, additional authentication data).\n\nThe \"loc\" member is set by the API user, and the \"tag\" member is set by `scrObject.encrypt()`.\n\n\n## Dealing with Content\n\nTo encrypt content:\n\n```\n// {input} is one of:\n// -  a node.js Buffer\n// -  an ArrayBuffer\n// -  a TypedArray\nscrObject.encrypt(input).\n    then(function(output) {\n      // {output} is *just* the encrypted content, as a Buffer\n      // \"tag\" member of {scrObject} is populated with authentication tag\n      ....\n    });\n```\n\nThe result from `encrypt()`'s resolved Promise can be passed directly to a WebSocket, XMLHttpRequest, or other processor.\n\nTo decrypt content:\n\n```\n// *NOTE:* {scrObject} has the correct \"tag\" for the (encrypted) content\nscrObject.decrypt(output).\n    then(function(input) {\n      // {input} is the decrypted content, as a Buffer\n      ....\n    });\n```\n\n## Importing/Exporting as a JWE ##\n\nEncrypted JWEs are appropriate to be shared with recipients.\n\nTo export the SCR as a JWE:\n\n```\nvar jwe;\n// {key} is a JWK from 'node-jose', or the JSON representation of a JWK\nscrObject.toJWE(key).\n    then(function(result) {\n      // {result} is a string representing the JWE using the Compact Serialization\n      jwe = result;\n    });\n```\n\nTo import the SCR from a JWE:\n\n```\nvar scrObject;\n// {key} is a JWK from 'node-jose', or the JSON representation of a JWK\n// {jwe} is a JWE using any of the serializations (Compact, JSON Flattened, JSON General)\nSCR.fromJWE(key, jwe).\n    then(function(result) {\n      // {result} is a SCR object\n      scrObject = result;\n    });\n```\n\n## As JSON ##\n\n**NOTE:** The JSON representation **SHOULD NOT** be shared outside of running code.  It contains all the information necessary to decrypt content\n\nAn SCR has the following members (presented as [JCR](https://tools.ietf.org/html/draft-newton-json-content-rules)):\n\n```\nscr {\n  \"enc\" : string,   ; Content Encryption Algorithm from [RFC7518]\n  \"key\" : string,   ; base64url-encoded raw key value\n  \"iv\"  : string,   ; base64url-encoded initialization vector\n  \"aad\" : string,   ; Additional authenticated data (AAD)\n  \"loc\" : ? uri,    ; Location of encrypted content\n  \"tag\" : ? string  ; base64url-encoded authentication tag\n}\n```\n\nThe \"loc\" and \"tag\" members are optional:\n\n* \"loc\" is set by the API user (usually after the encrypted content is published; e.g., uploaded to a sharing service)\n* \"tag\" is set by `scrObject.encrypt()`\n\nA complete example of an SCR as JSON:\n\n```\n{\n  \"enc\": \"A256GCM\",\n  \"key\": \"Ce3pe4stGd3tvZdSR3ekIoNjF3Q3V6R0oMN4SSGKbyI\",\n  \"iv\": \"AeU_KNtJ8dbl9k1N\",\n  \"aad\": \"2015-08-14T17:03:35.504Z\",\n  \"loc\": \"https://fireshare.example/files/db2daa25-cf41-492b-bc7b-90436949b17c\",\n  \"tag\": \"ZaRZ5vh1u7lyulUrvTKUDw\"\n}\n```\n\nTo export an SCR to a JSON object:\n\n```\nvar output = scrObject.toJSON();\n```\n\nTo import an SCR from a JSON object:\n\n```\nvar scrObject;\n// {input} is a JSON representation\nSCR.create(input).\n    then(function(result) {\n      scrObject = result;\n    });\n```\n","maintainers":[{"email":"linuxwolf@outer-planes.net","name":"linuxwolf"},{"email":"michael.wegman@gmail.com","name":"mwegman"},{"email":"foo@auggie.dev","name":"justaugustus"}],"time":{"modified":"2022-06-21T21:25:28.200Z","created":"2015-09-21T16:43:06.999Z","0.2.0":"2015-09-21T16:43:06.999Z","0.2.1":"2015-10-13T21:44:05.567Z","0.2.2":"2016-08-23T17:09:35.581Z","0.3.0":"2020-10-21T17:38:28.760Z"},"homepage":"https://github.com/cisco/node-scr#readme","keywords":["scr","crypto","jose"],"repository":{"type":"git","url":"git+ssh://git@github.com/cisco/node-scr.git"},"contributors":[{"name":"Matthew A. Miller","email":"linuxwolf@outer-planes.net"}],"author":{"name":"Cisco Systems, Inc.","email":"https://www.cisco.com"},"bugs":{"url":"https://github.com/cisco/node-scr/issues"},"license":"Apache-2.0","readmeFilename":"README.md","users":{"shanewholloway":true}}