{"id":21121565,"url":"https://github.com/MAHMOUDELSAYED7/Secure-Storage-Manager","last_synced_at":"2025-07-08T21:32:54.128Z","repository":{"id":263143659,"uuid":"889492597","full_name":"MAHMOUDELSAYED7/Secure-Storage-Manager","owner":"MAHMOUDELSAYED7","description":"The Secure Storage Manager provides a Flutter utility using flutter_secure_storage for secure data handling. It includes features, setup, and examples, highlighting why it surpasses SharedPreferences for encryption. Ideal for developers needing secure storage in Flutter apps.","archived":false,"fork":false,"pushed_at":"2024-11-16T13:43:47.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T03:59:52.574Z","etag":null,"topics":["android","android-security","cache","database","encryption","flutter","flutter-secure-storage","flutter-security","ios","ios-security","keychain","keystore","pub-dev","pub-package","security","sharedpreferences","storage","token","tokens"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flutter_secure_storage","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MAHMOUDELSAYED7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security/secure_storage.dart","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-16T13:21:01.000Z","updated_at":"2024-11-16T13:52:46.000Z","dependencies_parsed_at":"2024-11-16T14:40:46.465Z","dependency_job_id":null,"html_url":"https://github.com/MAHMOUDELSAYED7/Secure-Storage-Manager","commit_stats":null,"previous_names":["mahmoudelsayed69/secure-storage","mahmoudelsayed7/secure-storage-manager"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MAHMOUDELSAYED7/Secure-Storage-Manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAHMOUDELSAYED7%2FSecure-Storage-Manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAHMOUDELSAYED7%2FSecure-Storage-Manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAHMOUDELSAYED7%2FSecure-Storage-Manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAHMOUDELSAYED7%2FSecure-Storage-Manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MAHMOUDELSAYED7","download_url":"https://codeload.github.com/MAHMOUDELSAYED7/Secure-Storage-Manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAHMOUDELSAYED7%2FSecure-Storage-Manager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264352910,"owners_count":23594994,"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","android-security","cache","database","encryption","flutter","flutter-secure-storage","flutter-security","ios","ios-security","keychain","keystore","pub-dev","pub-package","security","sharedpreferences","storage","token","tokens"],"created_at":"2024-11-20T03:51:57.386Z","updated_at":"2025-07-08T21:32:50.586Z","avatar_url":"https://github.com/MAHMOUDELSAYED7.png","language":"Dart","readme":"\n# Flutter Secure Storage\n\nA simple and efficient Flutter utility for managing secure data storage using the [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) package. This utility class allows you to securely save, read, check, delete, and clear sensitive data like tokens and user credentials.\n\n## Features\n\n- Save data securely to the device's storage\n- Read data from secure storage\n- Delete specific data securely\n- Check if a key exists in secure storage\n- Clear all stored data\n\n## Installation\n\nTo use the `SecureStorageManager`, you need to add `flutter_secure_storage` to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  flutter:\n    sdk: flutter\n  flutter_secure_storage: ^9.2.2 \n```\n\nRun `flutter pub get` to install the package.\n\n## Code Overview\n\nHere's an overview of how to use the `SecureStorageManager`:\n\n### Import the Class\n\n```dart\nimport 'package:your_project_path/secure_storage_manager.dart';\n```\n\n### Usage Examples\n\n**1. Writing Data**\n```dart\nawait SecureStorageManager.writeData('token', 'your_secure_token_here');\n```\n\n**2. Reading Data**\n```dart\nString? token = await SecureStorageManager.readData('token');\nif (token != null) {\n  print('Token: $token');\n} else {\n  print('No token found');\n}\n```\n\n**3. Deleting Data**\n```dart\nawait SecureStorageManager.deleteData('token');\n```\n\n**4. Checking Key Existence**\n```dart\nbool exists = await SecureStorageManager.containsKey('token');\nif (exists) {\n  print('Token exists in storage');\n} else {\n  print('Token does not exist');\n}\n```\n\n**5. Clearing All Data**\n```dart\nawait SecureStorageManager.clearAllData();\n```\n\n## Why Use **`flutter_secure_storage`** Instead of **`SharedPreferences`**\n\n### 1. **Security and Encryption**\n- **`flutter_secure_storage`**: Encrypts data stored on the device, ensuring that it is unreadable by unauthorized users or applications. It uses platform-specific secure solutions like Keychain (iOS) and Keystore (Android) to protect data.\n- **`SharedPreferences`**: Stores data in plain text and does not provide built-in encryption. This makes it vulnerable to data exposure, especially if the device is compromised.\n\n### 2. **Sensitive Data Storage**\n- **`flutter_secure_storage`**: Specifically designed for handling sensitive data such as tokens, passwords, and personal information. It minimizes security risks through encryption and secure data management.\n- **`SharedPreferences`**: Suitable for non-sensitive data like user settings or preferences. It should not be used for storing tokens or private information due to the lack of encryption.\n\n### 3. **Compliance and Best Practices**\n- **`flutter_secure_storage`**: Helps meet compliance and industry standards for handling sensitive data by providing robust security features.\n- **`SharedPreferences`**: Does not comply with security best practices for storing sensitive data since it lacks encryption and proper access controls.\n\n### Summary\nFor storing tokens and other secure data, using `flutter_secure_storage` is essential to protect against potential data breaches and ensure data integrity. `SharedPreferences` is a convenient solution for non-sensitive data but should be avoided for any information that requires security and encryption.\n\n## Security Considerations\n\n- Always handle tokens and other sensitive data with care to avoid potential data leaks or exposure.\n- Ensure your app's permissions and security policies align with data protection requirements.\n\n## Contact\n\nFor any questions or feedback, please reach out via email: [mahmoudelsayed.dev@gmail.com](mahmoudelsayed.dev@gmail.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMAHMOUDELSAYED7%2FSecure-Storage-Manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMAHMOUDELSAYED7%2FSecure-Storage-Manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMAHMOUDELSAYED7%2FSecure-Storage-Manager/lists"}