Skip to content

Marc-R2/encrypt_dart

Repository files navigation

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);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages