steemdart_ecc 0.4.4+0 copy "steemdart_ecc: ^0.4.4+0" to clipboard
steemdart_ecc: ^0.4.4+0 copied to clipboard

Elliptic curve cryptography functions in Dart. Private Key, Public Key, Signature, AES, Encryption, Decryption

example/steemdart_ecc_example.dart

import 'package:steemdart_ecc/steemdart_ecc.dart';

void main() {
  // Construct the Steem private key from string
  final privateKey = SteemPrivateKey.fromString(
      '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3');

  // Get the related Steem public key
  final publicKey = privateKey.toPublicKey();
  // Print the Steem public key
  print(publicKey.toString());

  // Going to sign the data
  final data = 'data';

  // Sign
  final signature = privateKey.signString(data);
  // Print the Steem signature
  print(signature.toString());

  // Recover the SteemPublicKey used to sign the data
  final recoveredSteemPublicKey = signature.recover(data);
  print(recoveredSteemPublicKey.toString());

  // Verify the data using the signature
  signature.verify(data, publicKey);
}
3
likes
110
pub points
14%
popularity

Publisher

unverified uploader

Elliptic curve cryptography functions in Dart. Private Key, Public Key, Signature, AES, Encryption, Decryption

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

bs58check, buffer, convert, crypto, http, json_annotation, pointycastle

More

Packages that depend on steemdart_ecc