{"id":4461,"url":"https://github.com/z-hao-wang/react-native-rsa","last_synced_at":"2025-08-25T07:32:36.768Z","repository":{"id":57339659,"uuid":"54174393","full_name":"z-hao-wang/react-native-rsa","owner":"z-hao-wang","description":"React native rsa crypto ","archived":false,"fork":false,"pushed_at":"2017-05-19T17:43:31.000Z","size":25,"stargazers_count":67,"open_issues_count":6,"forks_count":19,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T14:45:23.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/z-hao-wang.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":"2016-03-18T04:46:50.000Z","updated_at":"2025-07-19T00:31:25.000Z","dependencies_parsed_at":"2022-09-12T04:10:07.777Z","dependency_job_id":null,"html_url":"https://github.com/z-hao-wang/react-native-rsa","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/z-hao-wang/react-native-rsa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-hao-wang%2Freact-native-rsa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-hao-wang%2Freact-native-rsa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-hao-wang%2Freact-native-rsa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-hao-wang%2Freact-native-rsa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/z-hao-wang","download_url":"https://codeload.github.com/z-hao-wang/react-native-rsa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-hao-wang%2Freact-native-rsa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272024520,"owners_count":24860528,"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-08-25T02:00:12.092Z","response_time":1107,"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":[],"created_at":"2024-01-05T20:17:13.300Z","updated_at":"2025-08-25T07:32:36.733Z","avatar_url":"https://github.com/z-hao-wang.png","language":"JavaScript","funding_links":[],"categories":["Components"],"sub_categories":["Utils \u0026 Infra"],"readme":"# react-native-rsa\nReact native rsa crypto lib\n\n## The use case\nInitially this was created for encrypted messaging\n\nClient would generate RSA key pairs and store private key locally and share the public key.\n\n## How to use\n\n\n```\nnpm install react-native-rsa\n```\nGenerate RSA keys\n```\nvar RSAKey = require('react-native-rsa');\nconst bits = 1024;\nconst exponent = '10001'; // must be a string. This is hex string. decimal = 65537\nvar rsa = new RSAKey();\nrsa.generate(bits, exponent);\nvar publicKey = rsa.getPublicString(); // return json encoded string\nvar privateKey = rsa.getPrivateString(); // return json encoded string\n```\n\nEncrypt\n\n```\nvar rsa = new RSAKey();\nrsa.setPublicString(publicKey);\nvar originText = 'sample String Value';\nvar encrypted = rsa.encrypt(originText);\n```\n\nDecrypt\n```\nrsa.setPrivateString(privateKey);\nvar decrypted = rsa.decrypt(encrypted); // decrypted == originText\n```\n\nTested works with ursa in nodejs (with ursa padding set to PKCS1).\n\n## Credits\nThis lib uses Tom Wu's jsbn http://www-cs-students.stanford.edu/~tjw/jsbn/\n\n## TODO: Still missing export to PEM format\n\n## Known issues:\n* Node js may complain about 'window' is not defined. I just commented out the 'window' related codes in rng.js and it worked. (It look like just adding some extra randomness. Should still work without that part). I don't recommend using this lib in nodejs. I use ursa or node-rsa lib for nodejs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz-hao-wang%2Freact-native-rsa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fz-hao-wang%2Freact-native-rsa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz-hao-wang%2Freact-native-rsa/lists"}