Bouncy Castle Security

Bouncy Castle Security is a Flutter plugin that leverages robust cryptographic algorithms like AES, SHA-1, and MD5 for secure encryption, decryption, password generation, and hashing, offering an easy-to-use API to ensure secure data handling and integration in Flutter applications.


pub package

Android
Android
iOS
iOS

Features

  • AES Encryption & Decryption: Safeguard sensitive data with AES encryption and decryption.
  • Password Generation: Dynamically generate secure passwords using custom master keys.
  • SHA-1 Hashing: Generate cryptographic hash values for data integrity.
  • MD5 Hashing: Perform MD5 hashing for additional security.
  • Index Generation: Create secure indices for advanced password mechanisms.

Installation

Add the following dependency to your pubspec.yaml file:

dependencies:
  bouncy_castle_security: ^0.0.3

Run the command:

flutter pub get

Platform Support

Platform Support
Android
iOS
Web 🚧

Getting Started

To use this plugin in your Flutter app, import the package:

import 'package:bouncy_castle_security/bouncy_castle_security.dart';

Initialize the Instance

Create an instance of BouncyCastleSecurity to access its methods:

final BouncyCastleSecurity _bouncyCastleSecurity = BouncyCastleSecurity.instance;

API Methods

1. encrypt

Encrypt a string using AES encryption.

String encryptedString = await _bouncyCastleSecurity.encrypt(data: "hello", password: "123");

2. decrypt

Decrypt an AES-encrypted string.

String decryptedString = await _bouncyCastleSecurity.decrypt(encryptedData: encryptedString, password: "123");

3. createPassword

Generate a secure password.

String password = await _bouncyCastleSecurity.createPassword(
  masterKey: "TestMasterKey",
  index: 1,
  order: "0123",
);

4. generateIndex

Generate a secure index value.

int index = await _bouncyCastleSecurity.generateIndex();

5. generateSHA1HashValue

Generate a SHA-1 hash for a string.

String sha1Hash = await _bouncyCastleSecurity.generateSHA1HashValue(data: "hello");

6. encryptDataMD5

Hash data using MD5.

String md5Hash = await _bouncyCastleSecurity.encryptDataMD5(data: "hello");

License

This plugin is distributed under the MIT License. See the LICENSE file for details.