{"id":21567553,"url":"https://github.com/haldarmahesh/flutter_key_store_cryptography","last_synced_at":"2025-04-10T13:22:46.381Z","repository":{"id":56829590,"uuid":"260640601","full_name":"haldarmahesh/flutter_key_store_cryptography","owner":"haldarmahesh","description":"This plugin helps you by generating the assymetric RSA key pair.  The keys are generated and persisted in android/ios keystore.","archived":false,"fork":false,"pushed_at":"2020-05-08T10:45:00.000Z","size":90,"stargazers_count":7,"open_issues_count":3,"forks_count":4,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-03-24T12:08:42.960Z","etag":null,"topics":["android","cryptography","dart","encrypts","flutter","ios-keystore","keystore","rsa-key-pair","signature"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haldarmahesh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-05-02T07:58:38.000Z","updated_at":"2024-11-11T19:35:39.000Z","dependencies_parsed_at":"2022-09-02T04:00:18.310Z","dependency_job_id":null,"html_url":"https://github.com/haldarmahesh/flutter_key_store_cryptography","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haldarmahesh%2Fflutter_key_store_cryptography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haldarmahesh%2Fflutter_key_store_cryptography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haldarmahesh%2Fflutter_key_store_cryptography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haldarmahesh%2Fflutter_key_store_cryptography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haldarmahesh","download_url":"https://codeload.github.com/haldarmahesh/flutter_key_store_cryptography/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225664,"owners_count":21068078,"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","cryptography","dart","encrypts","flutter","ios-keystore","keystore","rsa-key-pair","signature"],"created_at":"2024-11-24T10:31:36.569Z","updated_at":"2025-04-10T13:22:46.356Z","avatar_url":"https://github.com/haldarmahesh.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flutter key store cryptography\n\nThis plugin helps you by generating the assymetric RSA key pair. \n\nThe keys are generated and persisted in android/ios keystore.\n\n## Assymetric Key details \nThe details of keys generated and store in android/iOS keystore is as follows:\n* type -\u003e RSA\n* signature algorithm -\u003e SHA256withRSA\n* key size -\u003e 2048 bit\n\n### Android\n* The RSA key pair is stored android [Keystore](https://developer.android.com/training/articles/keystore.html)\n* AES encryption is used.\n* The AES secret is encrypted with RSA and stored in shared preference.\n* For Android 9 (API leverl 28) [StrongBox](https://developer.android.com/training/articles/keystore.html#HardwareSecurityModule) is enabled by default.\n* As keystore is available in Android 4.3 (API level 18) and hgher, hence this is minimum required Android.\n\n### iOS\n* The RSA key pair is stored in iOS [Keychain](https://developer.apple.com/documentation/security/keychain_services)\n* This plugin will run on iOS 10.0 and higher\n\n## Using plugin\nThis plugin exposes the following methods:\n* `getPublicKey`: returns the RSA public key\n* `encrypt`: encrypts the plain text using private key from the key pair\n* `verify`: verifies a signature and returns a boolean if the signature is signed by the same key pair.\n\n### 1) getPublicKey\nThis function is used to get the RSA public key which is store the android and ios key store.\nThis key pair is persisted in key store, i.e it is generated once, and always re used for signing and verification.\n\n#### defination\n\n```dart\nstatic Future\u003cString\u003e getPublicKey()\n```\n#### usage: \n\n```dart\nfinal String rsaPublicKey = await Cipher.getPublicKey();\n```\n\n### 2) sign\nThis function returns a signature which is signed by the platoform's private key.\n#### defination\n\n```dart\nstatic Future\u003cString\u003e sign(String plainData)\n```\n\n#### usage: \n```dart\nfinal String signature = await Cipher.sign('some plain data');\n```\n\n### 3) verify\nThis function returns a boolean, and takes a plain data and signature.\n\nThis function verifies the signature against the plain data, it returns `true` if the signature is produced by the same device's private key.\n\n#### defination\n\n```dart\nstatic Future\u003cbool\u003e verify(String plainText, String signature)\n```\n\n#### usage:\n```dart\nfinal bool result = await Cipher.verify('somePassword', 'SIGNATURE-XX');\n```\n\nThe above will checks if the `SIGNATURE-XX` matches the `somePassword` or not. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaldarmahesh%2Fflutter_key_store_cryptography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaldarmahesh%2Fflutter_key_store_cryptography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaldarmahesh%2Fflutter_key_store_cryptography/lists"}