cat > README.md << 'EOF'

biometric_iot_bridge

Flutter biometric authentication and secure MQTT IoT bridge. Verify users with platform biometrics, generate cryptographic tokens, and trigger trusted device actions with hardware-level security.

Pub Version Flutter License Security IoT


โœจ What is biometric_iot_bridge?

biometric_iot_bridge is a Flutter plugin that connects device biometrics with secure token generation and IoT device signaling.

It allows Flutter apps to securely:

  • Verify users using fingerprint / face / device credentials
  • Generate cryptographically secure tokens
  • Send trusted commands to IoT devices via MQTT

This package is designed for security-sensitive, device-aware, and remote-control workflows.


๐Ÿš€ Core Capabilities

Feature Description
โœ… Biometric Auth Native platform APIs (fingerprint, face, device pin)
โœ… Secure Tokens Cryptographic hashing โ€” no raw biometric storage
โœ… MQTT Signaling Publish tokens to IoT topics via MQTT
โœ… Flutter-First Clean, minimal Dart API
โœ… Multi-Platform Android, iOS, Windows, macOS

๐Ÿ“ฆ Installation

Add to your pubspec.yaml:

dependencies:
  biometric_iot_bridge: ^0.1.0

Then fetch packages:

flutter pub get

โš™๏ธ Platform Setup

Android

Add to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>

iOS

Add to ios/Runner/Info.plist:

<key>NSFaceIDUsageDescription</key>
<string>This app uses Face ID / Touch ID to verify your identity.</string>

Windows / macOS

No additional setup required. Uses native device authentication APIs.


๐Ÿ›  Quick Start

1. Import

import 'package:biometric_iot_bridge/biometric_iot_bridge.dart';

2. Initialize

final bridge = BiometricIotBridge();

3. Verify Biometrics

final authenticated = await bridge.verifyBiometrics();

if (!authenticated) {
  print("Authentication failed");
  return;
}

4. Generate Secure Token

final token = bridge.generateSecureToken("my_secret_key");

5. Send Signal to IoT Device

await bridge.sendRemoteSignal("iot/unlock", token);

๐Ÿ”„ Full End-to-End Example

import 'package:flutter/material.dart';
import 'package:biometric_iot_bridge/biometric_iot_bridge.dart';

class SecureUnlockPage extends StatefulWidget {
  @override
  _SecureUnlockPageState createState() => _SecureUnlockPageState();
}

class _SecureUnlockPageState extends State<SecureUnlockPage> {
  final bridge = BiometricIotBridge();
  String _status = "Ready";

  Future<void> _triggerUnlock() async {
    setState(() => _status = "Verifying biometrics...");

    final authenticated = await bridge.verifyBiometrics();
    if (!authenticated) {
      setState(() => _status = "Authentication failed.");
      return;
    }

    setState(() => _status = "Generating token...");
    final token = bridge.generateSecureToken("your_secret_key");

    setState(() => _status = "Sending signal...");
    await bridge.sendRemoteSignal("iot/door/unlock", token);

    setState(() => _status = "โœ… Door unlocked!");
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("Secure IoT Unlock")),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(_status, style: TextStyle(fontSize: 18)),
            SizedBox(height: 24),
            ElevatedButton.icon(
              icon: Icon(Icons.fingerprint),
              label: Text("Authenticate & Unlock"),
              onPressed: _triggerUnlock,
            ),
          ],
        ),
      ),
    );
  }
}

๐Ÿ” Security Design

This package follows a non-invasive security model:

  • Uses platform-native biometric APIs โ€” no raw biometric data is accessed
  • Does NOT store fingerprint or face data
  • Token generation uses cryptographic hashing via the crypto package
  • Designed for trust signaling, not identity management

โš ๏ธ Important: Developers must still validate tokens server-side or device-side.


๐Ÿงฉ Example Use Cases

  • ๐Ÿ”’ Smart locks and secure physical access
  • ๐Ÿ  IoT home automation with biometric gating
  • ๐Ÿญ Industrial device control with hardware-level trust
  • ๐Ÿ”‘ Device-bound authorization flows
  • ๐Ÿ›ก๏ธ Multi-factor security architectures
  • ๐Ÿ“ก Trusted remote command pipelines

โš™๏ธ Supported Platforms

Platform Status
Android โœ… Supported
iOS โœ… Supported
Windows โœ… Supported (device auth dependent)
macOS โœ… Supported
Linux โš ๏ธ Biometric API dependent

๐Ÿ“– API Reference

verifyBiometrics()

Future<bool> verifyBiometrics()

Triggers platform biometric authentication. Returns true on success.


generateSecureToken(String secret)

String generateSecureToken(String secret)
Parameter Type Description
secret String Your app secret key for token generation

Returns a hex-encoded hash token string.


sendRemoteSignal(String topic, String token)

Future<void> sendRemoteSignal(String topic, String token)
Parameter Type Description
topic String MQTT topic e.g. "iot/door/unlock"
token String Token from generateSecureToken()

๐Ÿ“ฆ Dependencies

Package Version Purpose
local_auth ^2.0.0 Platform biometric authentication
mqtt_client ^10.0.0 MQTT messaging
crypto ^3.0.0 Secure token generation

๐Ÿ— Design Goals

biometric_iot_bridge prioritizes:

  • Predictability โ€” clear, consistent API behaviour
  • Minimal abstraction โ€” thin wrapper, easy to extend
  • Security-aware defaults โ€” no data stored, no raw biometric access
  • Easy integration โ€” works with any MQTT broker or backend

๐Ÿค Contributing

Contributions and suggestions are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/your-feature)
  3. Commit your changes
  4. Submit a pull request

Repository: https://github.com/SEOSiri-Official/biometric_iot_bridge


๐Ÿ“œ License

MIT License. See LICENSE for details.


๐ŸŒ Attribution & Maintenance

Developed by Momenul Ahmad ยท SEOSiri


โญ Support

If this package is useful:

  • โญ Star the GitHub repository
  • ๐Ÿ‘ Like on pub.dev
  • ๐Ÿ’ฌ Share with other Flutter developers
  • ๐Ÿ› Report issues or suggest improvements EOF