{"id":19947022,"url":"https://github.com/ko-devhong/react-native-crypto-rsa","last_synced_at":"2025-03-01T14:18:00.491Z","repository":{"id":236217611,"uuid":"792159163","full_name":"ko-devHong/react-native-crypto-rsa","owner":"ko-devHong","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-09T05:28:04.000Z","size":1658,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T17:50:30.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/ko-devHong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2024-04-26T05:12:02.000Z","updated_at":"2024-05-09T05:28:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae4bb2ad-ab8e-42d1-bb2f-751917757903","html_url":"https://github.com/ko-devHong/react-native-crypto-rsa","commit_stats":null,"previous_names":["ko-devhong/react-native-crypto-rsa"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko-devHong%2Freact-native-crypto-rsa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko-devHong%2Freact-native-crypto-rsa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko-devHong%2Freact-native-crypto-rsa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ko-devHong%2Freact-native-crypto-rsa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ko-devHong","download_url":"https://codeload.github.com/ko-devHong/react-native-crypto-rsa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241374542,"owners_count":19952545,"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-13T00:33:57.587Z","updated_at":"2025-03-01T14:18:00.443Z","avatar_url":"https://github.com/ko-devHong.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @ko-developerhong/react-native-crypto-rsa\n\n## introduce\n\u003e`@ko-developerhong/react-native-crypto-rsa` The library provides RSA encryption and decryption in React Native applications, which allow you to generate public and private keys, and encrypt or decrypt messages.\n\n## Installation\n\n```sh\nnpm install @ko-developerhong/react-native-crypto-rsa\n```\n\n## iOS\n1. Add the following lines to the Podfile.\n```Podfile\npod 'react-native-crypto-rsa', :path =\u003e '../node_modules/react-native-crypto-rsa'\n```\n2. From the terminal, go to the root directory of the project and issue the `pod install` command.\n```shell\ncd ios\npod install\n# OR\nnpx pod-install ios\n```\n### Manual Installation\n\u003e Open `Xcode`, click Project Files, and add `libreact-native-crypto-rsa.a` to the `Link Binary With Libraries` section on the `Build Phases` tab.\n\n## Usage\n\n### Generating public and private keys\n- The `publicKey` value is returned in the form of a `pemString`.\n```tsx\nimport RNCryptoRsa from '@ko-developerhong/react-native-crypto-rsa';\n\n// keySize: An integer value representing the size of the key to be generated. The default is 2048.\nconst keySize = 2048\nconst { publicKey } = await RNCryptoRsa.init(keySize);\nconst publicKeyPemString = await RNCryptoRsa.getPublicKey();\n```\n\n### Encrypt and decrypt messages\n```tsx\nimport RNCryptoRsa from '@ko-developerhong/react-native-crypto-rsa';\n\nconst encryptedMessage = await RNCryptoRsa.encrypt('Hello, World!', publicKey);\nconst decryptedMessage = await RNCryptoRsa.decrypt(encryptedMessage); // Hello, World!\n```\n\n### SHA512 hash generation\n```tsx\nimport RNCryptoRsa from '@ko-developerhong/react-native-crypto-rsa';\n\nconst { publicKey } = await RNCryptoRsa.init(keySize);\nconst sha512Text = await RNCryptoRsa.getSHA512Text(publicKey); // hashText\n```\n\n## Precautions\n\u003e RSA encryption and decryption are CPU and memory intensive, which can affect performance when handling large amounts of data.\n\u003e Public and private keys are critical to security, so they should be stored in a secure place and deleted if unnecessary.\n\u003e The public key is used to encrypt the message, and the private key is used to decrypt the encrypted message.\n\n## Example\n```shell\nyarn example start\n\nyarn example android\n# OR\nyarn example ios\n```\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fko-devhong%2Freact-native-crypto-rsa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fko-devhong%2Freact-native-crypto-rsa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fko-devhong%2Freact-native-crypto-rsa/lists"}