{"id":31581327,"url":"https://github.com/orsinium-labs/subcrypt","last_synced_at":"2026-01-20T17:36:47.754Z","repository":{"id":316623692,"uuid":"1061730499","full_name":"orsinium-labs/subcrypt","owner":"orsinium-labs","description":"Type-safe cross-environment encryption library","archived":false,"fork":false,"pushed_at":"2025-09-25T17:56:09.000Z","size":138,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-25T19:15:28.303Z","etag":null,"topics":["aes","crypto","encryption","expo","js","react-native","rsa","rsa-oaep","rsa-pss","subtlecrypto","ts","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/subcrypt","language":"TypeScript","has_issues":false,"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/orsinium-labs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-22T09:59:57.000Z","updated_at":"2025-09-25T17:56:11.000Z","dependencies_parsed_at":"2025-09-25T19:16:12.631Z","dependency_job_id":"0f2a1b9a-1634-478a-a226-a6991c74442a","html_url":"https://github.com/orsinium-labs/subcrypt","commit_stats":null,"previous_names":["orsinium-labs/subcrypt"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/orsinium-labs/subcrypt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsinium-labs%2Fsubcrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsinium-labs%2Fsubcrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsinium-labs%2Fsubcrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsinium-labs%2Fsubcrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orsinium-labs","download_url":"https://codeload.github.com/orsinium-labs/subcrypt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsinium-labs%2Fsubcrypt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278526240,"owners_count":26001326,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aes","crypto","encryption","expo","js","react-native","rsa","rsa-oaep","rsa-pss","subtlecrypto","ts","typescript"],"created_at":"2025-10-05T21:56:21.853Z","updated_at":"2025-10-05T21:56:22.668Z","avatar_url":"https://github.com/orsinium-labs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# subcrypt\n\n[ [github](https://github.com/orsinium-labs/subcrypt) ] [ [npm](https://www.npmjs.com/package/subcrypt) ]\n\nType-safe cross-environment encryption (RSA/AES) library for JS/TS built on top of [crypto.subtle](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto).\n\nFeatures:\n\n- Works in browser, node.js, react native, and expo.\n- Type-safe and written in TypeScript.\n- Safe defaults.\n- Friendly API that doesn't require deep technical knowledge of cryptography.\n- 100% test coverage.\n\n## Installation\n\n```bash\nnpm i --save subcrypto\n```\n\nFor React Native (or Expo) projects, you also need to install [react-native-webview-crypto](https://github.com/webview-crypto/react-native-webview-crypto?tab=readme-ov-file):\n\n```bash\nnpm install --save react-native-webview react-native-webview-crypto\n```\n\nSee the [project documentation](https://github.com/webview-crypto/react-native-webview-crypto?tab=readme-ov-file#usage) on how to enable `react-native-webview-crypto` polyfill.\n\n## Usage\n\nSymmetric encryption:\n\n```js\nimport { Salt, SymEnc, encrypt, decrypt } from \"subcrypt\";\n\n// generate a new AES key\nlet key = await SymEnc.generate();\n\n// or derive it from a password\nconst salt = Salt.fromString(\"som3thing r@ndom\");\nkey = await SymEnc.derive(\"p@ssw0rd\", salt);\n\n// export key\nconst dump = await SymEnc.armor(key);\n\n// encrypt a message\nconst encMsg = await encrypt(key, \"oh hi mark\", salt);\n\n// import key\nkey = await SymEnc.dearmor(dump);\n\n// decrypt encrypted message\nconst plainMsg = await decrypt(key, encMsg, salt);\n```\n\nAsymmetric encryption:\n\n```js\nimport { EncryptKey, EncPair, encrypt, decrypt } from \"subcrypt\";\n\n// generate a new RSA key pair\nlet pair = await EncPair.generate();\n\n// export public encryption key\nconst dump = await EncryptKey.armor(key);\n\n// import key\nconst encKey = await EncryptKey.dearmor(dump);\n\n// encrypt a message using the encryption key\nconst encMsg = await encrypt(encKey, \"oh hi mark\");\n\n// or using the key pair\nencMsg = await encrypt(pair, \"oh hi mark\");\n\n// decrypt encrypted message\nconst plainMsg = await decrypt(pair, encMsg);\n```\n\nAsymmetric signatures:\n\n```js\nimport { SignPair, VerifyKey, sign, verify } from \"subcrypt\";\n\n// generate a new RSA key pair\nlet pair = await SignPair.generate();\n\n// encrypt a message using the pair\nconst msg = \"oh hi mark\";\nconst sig = await sign(pair, msg);\n\n// export public verification key\nconst dump = await VerifyKey.armor(key);\n\n// import key\nconst verifyKey = await VerifyKey.dearmor(dump);\n\n// verify message using the public key\nconst isOk = await verify(verifyKey, msg, sig);\n\n// or using the key pair\nisOk = await verify(pair, msg, sig);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forsinium-labs%2Fsubcrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forsinium-labs%2Fsubcrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forsinium-labs%2Fsubcrypt/lists"}