biometric_crypto 1.0.7
biometric_crypto: ^1.0.7 copied to clipboard
Flutter plugin for secure biometric-based cryptographic operations using Android Keystore and iOS Secure Enclave.
🔐 biometric_crypto #
A robust Flutter plugin that provides secure biometric authentication with cryptographic key generation.
✨ Features #
- Secure Key Generation: Generates RSA key pairs using platform-specific secure storage:
- 🤖 AndroidKeyStore on Android
- 🍎 Secure Enclave on iOS
- Public Key Export: Returns the public key for server-side verification
- Biometric Authentication: Seamless biometric sign-in verification
- Cross-Platform: Supports both Android and iOS
📋 Requirements #
- Flutter SDK
- Android 5.0+ (API level 21) or iOS 12.0+
🚀 Getting Started #
Android Setup #
1. Update MainActivity
Ensure your MainActivity extends FlutterFragmentActivity:
class MainActivity : FlutterFragmentActivity() {
// ...
}
2. Add Required Permissions
Add the following permissions to your AndroidManifest.xml:
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
iOS Setup #
Add Face ID Usage Description
Add a Face ID usage description to your Info.plist:
<key>NSFaceIDUsageDescription</key>
<string>Biometric authentication is used to secure your account.</string>
macOS Setup #
1. Open your project's macOS workspace: open macos/Runner.xcworkspace
2. In the project navigator, click on the Runner project, then select the Runner target.
3. Go to the Signing & Capabilities tab.
4. Click the + Capability button in the top left corner.
5. Search for Keychain Sharing and double-click to add it.
⚠️ Important Notes #
iOS Simulator Limitation: The Secure Enclave is not available on the iOS Simulator. A biometric prompt will appear when calling authenticate methods before sign-in.
📚 Next Steps #
- Explore the example app in the
example/directory - Check out the API documentation for detailed method references
- Review integration tests in
integration_test/for implementation patterns
For questions, contributions, or to report issues, please visit the project repository or refer to the troubleshooting section in the documentation.