{"id":18357572,"url":"https://github.com/reime005/react-native-secure-element","last_synced_at":"2025-04-06T13:31:25.218Z","repository":{"id":36807260,"uuid":"229588067","full_name":"reime005/react-native-secure-element","owner":"reime005","description":"The most secure way to encrypt and decrypt personal data on a mobile device. Automatically E2E tested and deployed via Github Actions CI/CD.","archived":false,"fork":false,"pushed_at":"2023-01-26T14:48:25.000Z","size":1851,"stargazers_count":33,"open_issues_count":9,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T13:14:39.658Z","etag":null,"topics":["android","hacktoberfest","ios","java","keychain","keystore","objc","react","react-native","security","typescript"],"latest_commit_sha":null,"homepage":"","language":"Java","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/reime005.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2019-12-22T15:22:15.000Z","updated_at":"2025-01-22T16:41:35.000Z","dependencies_parsed_at":"2023-02-14T18:16:20.954Z","dependency_job_id":null,"html_url":"https://github.com/reime005/react-native-secure-element","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reime005%2Freact-native-secure-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reime005%2Freact-native-secure-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reime005%2Freact-native-secure-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reime005%2Freact-native-secure-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reime005","download_url":"https://codeload.github.com/reime005/react-native-secure-element/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247488467,"owners_count":20946951,"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":["android","hacktoberfest","ios","java","keychain","keystore","objc","react","react-native","security","typescript"],"created_at":"2024-11-05T22:14:24.246Z","updated_at":"2025-04-06T13:31:24.256Z","avatar_url":"https://github.com/reime005.png","language":"Java","readme":"\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.png\" width=\"350\" title=\"hover text\"\u003e\n  \u003cp align='center'\u003eSecure Element for React Native\u003c/p\u003e\n\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\n\nReact Native Secure Element provides functionality to use on-device and hardware-based secure encryption and decryption.\n\nBoth native modules are also usable without React Native via gradle and cocoa pods. Thus, they also benefit from being tested by E2E tests.\n\nThe Android side uses the `android.security.keystore` API and requires a minimum SDK version of 23, due to availability of the hardware-backed security.\n\nThe iOS side uses the CommonCrypto and LocalAuthentication APIs. It saves the key pairs in the keychain or secure enclave if available.\n\n\u003c/p\u003e\n\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\n[![npm](https://img.shields.io/npm/v/react-native-secure-element.svg?style=flat-square)](http://npm.im/react-native-secure-element)\n![GitHub](https://img.shields.io/github/license/reime005/react-native-secure-element.svg?style=flat-square)\n![Android](https://github.com/reime005/react-native-secure-element/workflows/Android/badge.svg)\n![iOS](https://github.com/reime005/react-native-secure-element/workflows/iOS/badge.svg)\n\n\u003cdiv style=\"font-size:10px; color: grey\"\u003eIcons made by \u003ca href=\"https://www.flaticon.com/authors/freepik\" title=\"Freepik\"\u003eFreepik\u003c/a\u003e from \u003ca href=\"https://www.flaticon.com/\" title=\"Flaticon\"\u003ewww.flaticon.com\u003c/a\u003e\u003c/div\u003e\n\nSee examples in [src/examples](./src/examples).\n\n```javascript\n// React Hooks example\nimport { useSecureElement } from 'react-native-secure-element';\n\nconst Example = () =\u003e {\n  const { encrypt } = useSecureElement();\n  const [encryptedBase64Text, setEncryptedBase64Text] = useState('');\n\n  useEffect(\n    async () =\u003e {\n      try {\n        const val = await encrypt('someKey', 'toEncrypt');\n        setEncryptedBase64Text(val);\n      } catch (e) {\n        console.warn(e);\n        setEncryptedBase64Text(e.message);\n      }\n    },\n    []\n  )\n\n  \u003cView\u003e\n    \u003cText\u003e{encryptedBase64Text}\u003c/Text\u003e\n  \u003c/View\u003e\n}\n```\n\n## Automated E2E (UI) Tests Preview\n\nWith Github Actions, each commit automatically triggers a full build cycle. This includes running End-to-End (E2E) or UI tests on an iOS Simulator and Android Emulator. This has the benefit of having only tested and not _breaking code_ merged into the *master* branch.\n\n![E2E Tests](https://s5.gifyu.com/images/secure-element-min.gif)\n\n## Features\n\n  - Full TypeScript support\n  - Automatically deployed and tested (CI/CD) via Github Actions\n  - Extremely secure iOS encryption and decryption via secure enclave, keychain and elliptic curves. No third party dependencies\n  - Very secure Android encryption and decryption via Android KeyStore\n  - Natively (without React Native) available implementation\n\n## Why / Purpose\n\nThe purpose of this repository is to provide a secure way to decrypt and encrypt values. Such values could consist of sensitive user data or authentication secrets (TOTP, ...).\n\n## API\n\nSee types definition in [src/typescript](./src/typescript/index.d.ts).\n\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\n## Installation\n\nTo install react-native-secure-element, do either\n\n```bash\nnpm install --save react-native-secure-element\n```\n\nor\n\n```bash\nyarn add react-native-secure-element\n```\n\nNote that this requires a react-native version of at least 0.60.0, to use its auto linking feature.\n\n### Native Android Dependency\n\nVia gradle/maven dependency:\n\n```groovy\nimplementation 'com.android.secureelement:android:+'\n```\n\n### Native iOS Dependency\n\nVia cocoapods dependency:\n\n```ruby\npod 'SecureElement'\n```\n\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\n---\n\n## TODO\n\nSorted by priority (higher = higher).\n\n* User authentication functionality (without encryption)\n* Signing certificates\n* React Hooks\n* Error handling/formatting\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freime005%2Freact-native-secure-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freime005%2Freact-native-secure-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freime005%2Freact-native-secure-element/lists"}