Search packages, repositories and app categories

Package detailsv1.0.4

native_encryptor

Securely encrypt/decrypt data in your Flutter app using native code. Add random salt and IV for enhanced security. Easy-to-use API, cross-platform compatible.

AndroidiOSmacOS
30-day downloads
22
Likes
6
Pub points
130

Install package

flutter pub add native_encryptor

Package Overview

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

NativeEncryptor is a Flutter package that enables secure encryption and decryption of data using native code on Android, iOS, and macOS. It enhances security by automatically adding random salts and initialization vectors (IVs) to each encryption operation. Designed with simplicity in mind, it offers an easy-to-use API while maintaining cross-platform compatibility. Ideal for protecting sensitive user data such as credentials, tokens, or personal information within mobile applications.

Use cases

  • Secure storage of user credentials
  • Encryption of local app data
  • Protection of sensitive configuration files
  • Secure transfer of encrypted payloads
  • Compliance with data privacy regulations

Key features

  • Uses native encryption for better performance
  • Automatically generates random salt and IV
  • Cross-platform support for Android, iOS, and macOS
  • Simple and intuitive API
  • Enhanced security through randomized encryption parameters

Suitable for

  • Apps requiring high data security
  • Developers building privacy-focused applications
  • Projects needing compliance with GDPR or HIPAA
  • Mobile apps handling sensitive user information
  • Teams prioritizing performance and security

Considerations

  • Requires native code integration on each platform
  • May increase app size slightly due to native dependencies
  • Not suitable for very large data sets due to memory constraints
  • Limited customization of encryption algorithms
  • Depends on correct implementation of key management outside the package

Original README

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

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!

Categories

Dependencies

Dependency list 2 items

  • plugin_platform_interface^2.1.8
  • web^1.1.0

Source repository

Projects using this package

No data available yet.