diffie_hellman 1.1.0 copy "diffie_hellman: ^1.1.0" to clipboard
diffie_hellman: ^1.1.0 copied to clipboard

Dart implementation of finite field Diffie-Hellman. Based on PKCS#3.

example/example.dart

import 'package:diffie_hellman/diffie_hellman.dart';

void main() {
  DhPkcs3Engine dhEngine = DhPkcs3Engine.fromGroup(DhGroup.g5);
  DhPkcs3Engine otherDhEngine = DhPkcs3Engine.fromGroup(DhGroup.g5);

  DhKeyPair keyPair = dhEngine.generateKeyPair();
  DhKeyPair otherKeyPair = otherDhEngine.generateKeyPair();

  print('Public Key: ${keyPair.publicKey.value}');
  print('Private Key: ${keyPair.privateKey.value}');
  print('Other public Key: ${otherKeyPair.publicKey.value}');
  print('Other private Key: ${otherKeyPair.privateKey.value}');

  print(
    'Secret Key: ${dhEngine.computeSecretKey(otherKeyPair.publicKey.value)}',
  );
  print(
    'Other secret Key: ${otherDhEngine.computeSecretKey(keyPair.publicKey.value)}',
  );
}
15
likes
0
points
263
downloads

Publisher

verified publisherxeertz.com

Weekly Downloads

Dart implementation of finite field Diffie-Hellman. Based on PKCS#3.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

asn1lib, equatable, meta

More

Packages that depend on diffie_hellman