搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.4

native_encryptor

使用原生程式碼在您的 Flutter 應用中安全地加密/解密資料。加入隨機鹽值與初始化向量以增強安全性。易於使用的 API,跨平台相容。

AndroidiOSmacOS
近 30 天下載
22
喜歡數
6
Pub 分數
130

安裝套件

flutter pub add native_encryptor

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

NativeEncryptor 是一個 Flutter 套件,可在 Android、iOS 和 macOS 上使用原生程式碼實現資料的安全加密與解密。它透過在每次加密作業中自動加入隨機鹽值與初始化向量(IV),提升安全性。設計上著重於簡潔性,提供易用的 API,同時維持跨平台相容性。非常適合用於保護行動應用程式中的敏感使用者資料,例如憑證、權杖或個人資訊。

適用情境

  • 使用者憑證的安全儲存
  • 本地應用資料加密
  • 敏感配置文件的保護
  • 加密負載的安全傳輸
  • 遵守資料隱私法規

主要特色

  • 使用原生加密以獲得更好的性能
  • 自動生成隨機鹽和初始化向量
  • 跨平台支援 Android、iOS 與 macOS
  • 簡單直覺的 API
  • 透過隨機加密參數增強安全性

適合對象

  • 需要高數據安全的應用程式
  • 開發注重隱私的應用程式開發者
  • 需要符合GDPR或HIPAA的項目
  • 處理敏感用戶資訊的移動應用
  • 注重效能與安全的團隊

使用建議

  • 每個平台都需要原生代碼整合
  • 由於原生依賴項,應用大小可能會略微增加
  • 由於記憶體限制,不適合非常大的資料集
  • 加密演算法的自訂有限
  • 取決於套件外部金鑰管理的正確實現

原始 README

以下為關聯原始碼儲存庫的 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!

所屬分類

依賴

依賴清單 2 項

  • plugin_platform_interface^2.1.8
  • web^1.1.0

原始碼儲存庫

使用此套件的專案

暫無相關資料。