{"id":29068942,"url":"https://github.com/aspectron/iris-crypt","last_synced_at":"2025-06-27T11:09:40.000Z","repository":{"id":74496999,"uuid":"45827883","full_name":"aspectron/iris-crypt","owner":"aspectron","description":null,"archived":false,"fork":false,"pushed_at":"2015-11-27T10:22:23.000Z","size":738,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2023-08-05T09:42:52.751Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/aspectron.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":"2015-11-09T09:24:17.000Z","updated_at":"2023-08-05T09:42:52.752Z","dependencies_parsed_at":"2023-03-12T14:00:39.041Z","dependency_job_id":null,"html_url":"https://github.com/aspectron/iris-crypt","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/aspectron/iris-crypt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Firis-crypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Firis-crypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Firis-crypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Firis-crypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aspectron","download_url":"https://codeload.github.com/aspectron/iris-crypt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Firis-crypt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262244913,"owners_count":23281029,"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":"2025-06-27T11:09:39.746Z","updated_at":"2025-06-27T11:09:39.978Z","avatar_url":"https://github.com/aspectron.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iris-crypt\n\nStore Node.js modules encrypted in a package file.\n\n**Requires: Node.js version \u003e=0.12**\n\n## Building\n\nRun `npm rebuild` to build native addon from the project sources. Additional\ncommand line option `--target` allows to set specific Node.js version.\n\n## Using\n\nThe module is indented to create an encrypted package with several Node.js modules\nand to use these modules from the package file.\n\nSee [`encrypt.js`](./tests/test.js) and [`decrypt.js`](./tests/decrypt.js) for usage example.\n\n## Documentation\n\nThe module consists of two binary parts exporting following functions:\n\n  - Encrypt part (allowed only if `iris-encrypt.node` addon exists)\n    * `generateAuth()` - generate authorization key\n    * `package()` - create encrypted package\n\n  - Decrypt part (in `iris-decrypt.node` addon)\n    * `load()` - load encrypted package\n\nPublisher encrypts a set of JavaScript files and modules into single package\nfile with generated authorization key.\n\nClient loads the package with the supplied authorization key and use `require()`\nfunction to load a particular module.\n\n```\nvar irisCrypt = require('iris-crypt');\n```\n\n### generateAuth(password, serial)\n\nCreate an authorization key string based on a `password` string\nand `serial` number. The serial number must be in a range [0..65535].\n\n```\nvar password = 'zzz';\nvar serial = 1234;\nvar auth = irisCrypt.makeAuth(password, serial);\n// assert(auth == 'EK4Z-3Z1E-SE4J-ANMZ-X390-917Z')\n```\n\n### package(auth, filename, files)\n\nCreate a single encrypted with `auth` key in a package file named as `filename`.\n\nThe package contents is set with `files` object, where each property in the\nobject is a module name and path pair:\n\n```\nirisCrypt.package(auth, 'some/where/filename.pkg', {\n\t'module1_name': 'path/to/module1',\n\t'module2_name': 'another/path/to/module2',\n});\n```\n\n### load(auth, filename)\n\nLoad a package from a file named as `filename` and decrypt it with `auth`.\n\nReturns a `Package` object with `require(name)` function wich loads a module from\nthe package.\n\n```\nvar pkg = irisCrypt.load(auth, 'some/where/filename.pkg');\n```\n\n### Package.require(name)\n\nLoad a module stored in the package. This function fallbacks to original Node.js\n`require()` function, if there is no such a module.\n\n```\nvar module1 = pkg.require('module1_name');\n// use exports from module1\n\nvar module2 = pkg.require('module2_name');\n\nvar fs = pkg.require('fs'); // load native Node.js module\n```\n\n### Package.serial\n\nThe serial number that was used for the package auth key generation.\nRead-only property.\n\n```\nvar sn = pkg.serial; // 1234\n```\n\n### Package.names\n\nAn array of module names stored in the package.\nRead-only property\n\n```\nvar modules = pkg.names; // ['module1_name', 'module2_name']\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspectron%2Firis-crypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faspectron%2Firis-crypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspectron%2Firis-crypt/lists"}