Search packages, repositories and app categories

Package detailsv3.0.1

flutter_keychain

Flutter secure storage via Keychain (iOS) and Keystore (Android). Supports optional iOS access groups and item labels.

AndroidiOS
30-day downloads
15.9K
Likes
86
Pub points
160

Install package

flutter pub add flutter_keychain

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Flutter Keychain provides secure, platform-specific storage for sensitive data using iOS Keychain and Android Keystore. It enables encrypted persistence of credentials and tokens with support for optional iOS access groups and item labels. Designed for high security, it ensures data is protected at the OS level, minimizing exposure to unauthorized access. Ideal for storing authentication tokens, API keys, or other confidential information in a way that respects platform security best practices.

Use cases

  • Storing user authentication tokens
  • Securely saving API keys
  • Persisting login credentials
  • Managing encryption keys
  • Handling sensitive user data
  • Enabling cross-app data sharing on iOS

Key features

  • Encrypted storage via OS keychain
  • Support for iOS access groups
  • Item labeling on iOS
  • Cross-platform compatibility
  • Secure data isolation
  • Automatic encryption

Suitable for

  • Apps requiring secure credential storage
  • Authentication-heavy applications
  • Compliance-focused projects
  • Mobile apps handling sensitive data
  • Developers targeting both iOS and Android
  • Applications needing OS-level security

Considerations

  • Requires proper permission handling
  • Limited to small data sizes
  • No direct data retrieval across platforms
  • Dependent on OS security features
  • Not suitable for large datasets
  • May require additional setup for iOS access groups

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flutter_keychain

A Flutter plugin for supporting secure storage of strings via Keychain and Keystore

If you have other types you want to store, you need to serialize to and from UTF-8 strings.

  • Keychain is used for iOS
  • AES encryption is used for Android. AES secret key is encrypted with RSA and RSA key is stored in KeyStore

Note KeyStore was introduced in Android 4.3 (API level 18). The plugin does not work on earlier versions.

Getting Started


import 'package:flutter_keychain/flutter_keychain.dart';
...

// Get value
var value = await FlutterKeychain.get(key: "key");

// Put value
await FlutterKeychain.put(key: "key", value: "value");

// Remove item
await FlutterKeychain.remove(key: "key");

// Clear the secure store
await FlutterKeychain.clear();

Configure Android version

In [project]/android/app/build.gradle set minSdkVersion to >= 18.

android {
    ...
    defaultConfig {
        ...
        minSdkVersion 18
        ...
    }
}

Contributing

For help on editing plugin code, view the documentation.

Categories

Source repository

Projects using this package