Crypt / Encrypt Dart

codecov

Installation

Simply make sure to add the following to your pubspec.yaml:

dependencies:
  crypt:
    git:
      url: https://github.com/Marc-R2/encrypt_dart.git

and run pub get or pub upgrade in the same directory as your pubspec.yaml.

Quick Start

import 'package:crypt/encrypt.dart';

Hashing

final hashed = Hash.sha256('Hello, World!').hashString; // or hashBytes or hashDig

Encrypting

final instance = AESHandler(); // or RSAHandler or ECCHandler
final encrypted = instance.encrypt(key: '<key>', data: 'Hello, World!');
final decrypted = instance.decrypt(encrypted);

Signing (only with ECCHandler)

final sign = ECCHandler.signData(privateKey: '<private key>', data: 'Hello, World!');
final verify = ECCHandler.verifyData(publicKey: '<public key>', data: 'Hello, World!', signature: sign);