encrypt
5.0.3, released 3 years ago by an unverified publisher
High‑level Dart APIs for encryption, decryption, signing and secure random generation.
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.
52Compare - puppeteer
A Dart port of Puppeteer to automate and control Chrome over the DevTools Protocol.
93Compare - webcrypto
Cross-platform implementation of Web Cryptography APIs for Dart.
89Compare - stream_channel
An abstraction for two-way communication channels based on the Dart Stream class.
79Compare
Works with
Packages commonly used together with encrypt: ones it builds on, ones built on it, and its own family.
- cryptoencrypt depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- clockencrypt depends on itA fakeable wrapper for dart:core clock APIs.
- argsencrypt depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- pointycastleencrypt depends on itA Dart library providing a wide range of cryptographic algorithms and primitives.
- asn1libencrypt depends on itEncodes and decodes ASN.1 objects using BER byte encoding in Dart.
- at_clientBuilt on encryptClient SDK for building apps on the atProtocol with end-to-end encryption.
- encrypt_shared_preferencesBuilt on encryptAES encrypted wrapper for shared_preferences to securely store sensitive data.
- sendbird_chat_sdkBuilt on encryptAdd real-time chat and messaging features to your Flutter application using the Sendbird backend.