FLUTTER ECOSYSTEM

subhashDev11/native_encryptor

ネイティブコードを使用して、Flutterアプリでデータを安全に暗号化/復号化します。セキュリティを強化するためにランダムなソルトとIVを追加します。使いやすく、クロスプラットフォーム対応です。

native_encryptor のプロジェクト画像
Stars
3
Forks
0
最終プッシュ(UTC)
2025/09/30
プロジェクト状態
公開中
Subhash Chandra Shukla GitHub avatar
GITHUB User

Subhash Chandra Shukla ↗

I am student by a profession and programmer by a passion.

Infinite Computer SolutionNoida公式サイト ↗
言語SwiftDartJavaJavaScriptHTMLRubyKotlinObjective-C

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 6 件
  • flutter{"sdk":"flutter"}
  • flutter_web_plugins{"sdk":"flutter"}
  • web^1.1.1
  • plugin_platform_interface^2.1.8
  • flutter_test開発用{"sdk":"flutter"}
  • flutter_lints開発用^6.0.0

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

Native Encryptor for Flutter

A powerful plugin for secure data handling in your Flutter apps.

Key Features

  • Native Code Integration: Ensures top-tier security and performance.
  • Random Salt & IV: Adds an extra layer of protection.
  • Passphrase-Based Encryption: Customizable and flexible security.
  • User-Friendly API:** Simplifies integration into your Flutter app.
  • Cross-Platform Compatibility: Works seamlessly on both iOS and Android.
Screenshots
encrypted_value decrypted_value input_content

Installation

  1. Add to pubspec.yaml:

    YAML

dependencies:
   native_encryptor: <latest_version>
  1. Fetch the plugin:

Bash

flutter pub get
  1. Import in your Dart code: Dart
     import 'package:native_encryptor/native_encryptor.dart';
    

Basic Usage

Dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final    _nativeEncryptorPlugin = NativeEncryptor();
  final TextEditingController _controller = TextEditingController(text: "Secret Message");
  String? encryptedData;
  String? decryptedData;
  final String passphrase = "YourSecretPassphrase";

  Future<void> encrypt() async {
    encryptedData = await _nativeEncryptorPlugin.encrypt(
      passPhrase: passphrase,
      contentToEncrypt: _controller.text,
    );
    setState(() {});
  }

  Future<void> decrypt() async {
    decryptedData = await _nativeEncryptorPlugin.decrypt(
      passPhrase: passphrase,
      concatenatedCipherText: encryptedData!,
    );
    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Native    Encryptor')),
        body: Padding(
          padding: const EdgeInsets.all(16.0),
          child: Column(
            children: [
              TextField(
                controller: _controller,
                decoration: const InputDecoration(labelText:    'Enter text'),
              ),
              ElevatedButton(onPressed: encrypt, child: const Text('Encrypt')),
              if (encryptedData != null)
                Text('Encrypted: $encryptedData'),
              ElevatedButton(onPressed: decrypt, child: const Text('Decrypt')),
              if (decryptedData != null)
                Text('Decrypted: $decryptedData'),
            ],
          ),
        ),
      ),
    );
  }
}

API Reference

  • encrypt({required String passPhrase, required String contentToEncrypt}) Encrypts the given content with the provided passphrase. Returns: The encrypted data as a string.
  • decrypt({required String passPhrase, required String concatenatedCipherText}) Decrypts the given encrypted data with the provided passphrase. Returns: The original decrypted content.
  • getPlatformVersion() Retrieves the current platform version for debugging purposes.

License

This plugin is licensed under the MIT License.

Contributing

We welcome contributions! Please feel free to open issues or submit pull requests.

Connect with me:

  • GitHub: https://github.com/subhashDev11
  • LinkedIn: https://www.linkedin.com/in/subhashcs/
  • Medium: https://medium.com/@subhashchandrashukla

Enhance your Flutter app's security with Native Encryptor!