{"id":20597095,"url":"https://github.com/tradle/react-native-crypto","last_synced_at":"2025-04-14T23:52:40.305Z","repository":{"id":54528496,"uuid":"46517612","full_name":"tradle/react-native-crypto","owner":"tradle","description":"partial implementation of node's `crypto` for react-native","archived":false,"fork":false,"pushed_at":"2022-09-12T07:41:51.000Z","size":302,"stargazers_count":377,"open_issues_count":26,"forks_count":83,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-14T23:52:21.696Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/tradle.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-19T20:12:54.000Z","updated_at":"2025-01-23T07:22:15.000Z","dependencies_parsed_at":"2022-08-13T18:50:14.032Z","dependency_job_id":null,"html_url":"https://github.com/tradle/react-native-crypto","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Freact-native-crypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Freact-native-crypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Freact-native-crypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Freact-native-crypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tradle","download_url":"https://codeload.github.com/tradle/react-native-crypto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981260,"owners_count":21193144,"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":"2024-11-16T08:20:18.286Z","updated_at":"2025-04-14T23:52:40.284Z","avatar_url":"https://github.com/tradle.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# react-native-crypto\n\nNote: this module is a clone of [crypto-browserify](https://github.com/crypto-browserify/crypto-browserify), with randombytes replaced.\n\nA port of node's `crypto` module to React Native.\n\n## DEPRECATED\n\nyou should probably use a combination of:\n- react-native-get-random-values to shim getRandomValues\n- crypto-browserify\n\n## install\n\nBecause this module depends on some node core modules, and react-native doesn't currently have a [resolve.alias a la webpack](https://productpains.com/post/react-native/packager-support-resolvealias-ala-webpack), you will need to use [rn-nodeify](https://github.com/tradle/rn-nodeify) for your shimming needs.\n\nA suggested workflow:\n\n1. Install\n  ```sh\n  npm i --save react-native-crypto\n  # install peer deps\n  npm i --save react-native-randombytes\n  react-native link react-native-randombytes # on RN \u003e= 0.60, instead do: cd iOS \u0026\u0026 pod install\n  # install latest rn-nodeify\n  npm i --save-dev rn-nodeify\n  # install node core shims and recursively hack package.json files\n  # in ./node_modules to add/update the \"browser\"/\"react-native\" field with relevant mappings\n  ./node_modules/.bin/rn-nodeify --hack --install\n  ```\n\n2. `rn-nodeify` will create a `shim.js` in the project root directory\n  ```js\n  // index.ios.js or index.android.js\n  // make sure you use `import` and not require!  \n  import './shim.js'\n  import crypto from 'crypto'\n  // ...the rest of your code\n  ```\n\n## example\n\nsee https://github.com/mvayngrib/rncryptoexample\n\n## the crypto in this box\n\nWhat follows is unedited text from crypto-browserify\n\nThe goal of this module is to reimplement node's crypto module so that it can run in react-native supported environments.\n\nHere is the subset that is currently implemented:\n\n* createHash (sha1, sha224, sha256, sha384, sha512, md5, rmd160)\n* createHmac (sha1, sha224, sha256, sha384, sha512, md5, rmd160)\n* pbkdf2\n* pbkdf2Sync\n* randomBytes\n* pseudoRandomBytes\n* createCipher (aes)\n* createDecipher (aes)\n* createDiffieHellman\n* createSign (rsa, ecdsa)\n* createVerify (rsa, ecdsa)\n* createECDH (secp256k1)\n* publicEncrypt/privateDecrypt (rsa)\n* randomFillSync\n* randomFill\n\n## todo\n\nthese features from node's `crypto` are still unimplemented.\n\n* createCredentials\n* scryptSync\n\nthese features would benefit from native implementations\n\n* pbkdf2\n* createSign\n* createVerify\n* createECDH\n* publicEncrypto/privateDecrypt (rsa)\n\n## contributions\n\nIf you are interested in writing a feature, please implement as a new module,\nwhich will be incorporated into crypto-browserify as a dependency.\n\nAll deps must be compatible with node's crypto\n(generate example inputs and outputs with node,\nand save base64 strings inside JSON, so that tests can run in the browser.\nsee [sha.js](https://github.com/dominictarr/sha.js)\n\nCrypto is _extra serious_ so please do not hesitate to review the code,\nand post comments if you do.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Freact-native-crypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftradle%2Freact-native-crypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Freact-native-crypto/lists"}