dage 1.0.10 copy "dage: ^1.0.10" to clipboard
dage: ^1.0.10 copied to clipboard

age encryption implementation using Dart. age is a modern file encryption format with multiple pluggable recipients, and seekable streaming encryption.

example/dage.dart

import 'dart:typed_data';

import 'package:collection/collection.dart';
import 'package:dage/dage.dart';
import 'package:dage/src/plugin/x25519.dart';

void main() async {
  // Generate keypair
  final keyPair = await X25519AgePlugin.generateKeyPair();
  // Encryption
  final content = Uint8List.fromList('Hello World'.codeUnits);
  final encryptedFile = encrypt(Stream.value(content), [keyPair.recipient]);
  // Decryption
  final decrypted = decrypt(encryptedFile, [keyPair]);

  // Consume entire stream
  final bytes = await decrypted.toList();

  assert(String.fromCharCodes(bytes.flattened) == 'Hello World');
}
1
likes
140
pub points
4%
popularity

Publisher

verified publisherproducement.com

age encryption implementation using Dart. age is a modern file encryption format with multiple pluggable recipients, and seekable streaming encryption.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

args, async, bech32, collection, convert, cryptography, logging, petitparser, pointycastle

More

Packages that depend on dage