Skip to content
pubscout

encrypt

5.0.3, released 3 years ago by an unverified publisher

High‑level Dart APIs for encryption, decryption, signing and secure random generation.

WASM-readyRepository archivedQuiet but busy
$ flutter pub add encrypt
Source repository

What it does

Provides easy‑to‑use wrappers around PointyCastle for symmetric (AES, Salsa20, Fernet) and asymmetric (RSA) cryptography. Includes a CLI tool for generating cryptographically secure random bytes.

AI-written summary of version 5.0.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to encrypt/decrypt data locally on any platform (mobile, web, desktop).
  • You require simple RSA signing/verification or Fernet token handling.
  • You want a quick way to generate secure random keys or IVs via a CLI.

Skip it when

  • You need password hashing (use the dedicated password package).
  • You require fine‑grained control over low‑level cryptographic primitives.

Strengths

  • Broad algorithm support (AES modes, RSA, Salsa20, Fernet).
  • Cross‑platform (Android, iOS, Web, Windows, macOS, Linux).
  • Simple, declarative API with built‑in secure‑random CLI.

Weaknesses

  • Relies on PointyCastle, adding an extra dependency layer.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
6
import 'package:encrypt/encrypt.dart';

void main() {
  final key = Key.fromUtf8('my 32 length key................');
  final iv = IV.fromLength(16);
  final encrypter = Encrypter(AES(key));
  final encrypted = encrypter.encrypt('Hello', iv: iv);
  final decrypted = encrypter.decrypt(encrypted, iv: iv);
  print(decrypted);
}

Alternatives

Packages that do the same job and could replace encrypt.

  • encrypter_plus

    High-level APIs over PointyCastle for two-way cryptography, supporting AES, RSA, Salsa20, and Fernet.

  • puppeteer

    A Dart port of Puppeteer to automate and control Chrome over the DevTools Protocol.

  • webcrypto

    Cross-platform implementation of Web Cryptography APIs for Dart.

  • stream_channel

    An abstraction for two-way communication channels based on the Dart Stream class.

Works with

Packages commonly used together with encrypt: ones it builds on, ones built on it, and its own family.