dage 1.0.7 copy "dage: ^1.0.7" to clipboard
dage: ^1.0.7 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
0
pub points
32%
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

License

unknown (LICENSE)

Dependencies

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

More

Packages that depend on dage