Skip to content
pubscout

dart_pg

2.1.0, released 2 years ago by an unverified publisher

An OpenPGP implementation in Dart for encryption, decryption, and key management.

$ flutter pub add dart_pg
Source repository

What it does

Dart PG (Dart Privacy Guard) provides an implementation of the OpenPGP standard in Dart. It supports data signing and encryption, key management (generation, reading, and decryption), and various cryptographic algorithms, ciphers, and hash functions.

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

Use it when

  • You need OpenPGP encryption or decryption in your Dart or Flutter application.
  • You need to generate, read, and manage PGP keys locally.
  • You need to sign and verify cleartext messages or use detached signatures.

Skip it when

  • You require Blowfish, Camellia, or Twofish cipher engines, which were removed in version 2.1.0.
  • You need non-OpenPGP cryptographic primitives and prefer a lighter general-purpose cryptography library.

Strengths

  • Implements the OpenPGP standard (RFC 9580).
  • Supports multiple public-key algorithms (RSA, ECDSA, EdDSA, ECDH) and symmetric ciphers.
  • Pure Dart implementation supporting Android, iOS, Windows, macOS, and Linux.

Weaknesses

  • Some older ciphers like Blowfish, Camellia, and Twofish are no longer supported in version 2.1.0+.
  • Not documented for web platform support explicitly in the provided material.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
3

Add dart_pg to pubspec.yaml dependencies and run pub get.

const literalText = 'Hello Dart Privacy Guard!';
const password = 'secret stuff';

final encryptedMessage = OpenPGP.encryptCleartext(
    literalText, passwords: [password]
);
final armored = encryptedMessage.armor();
final literalMessage = OpenPGP.decrypt(
    armored, passwords: [password]
);
final literalData = literalMessage.literalData;

Works with

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