sm2cipher 0.0.7 copy "sm2cipher: ^0.0.7" to clipboard
sm2cipher: ^0.0.7 copied to clipboard

Encrypt and decrypt data use SM2, This is the High level API build amount pointycastle, specify Elliptic curve to SM2 can simplify the api.

example/main.dart

import 'package:sm2cipher/src/sm2Cipher.dart' as prefix0;

void main() {
  final kp = prefix0.generateKeyPair();
  // print('private: ${prefix0.strinifyPrivateKey(kp.privateKey)}');
  // print('public: ${prefix0.strinifyPublicKey(kp.publicKey)}');

  final serverPub =
      '02e13005599b039d914b6e2b5835c93f80874c931ceca77b920621e22bab623757';

  final enc = prefix0.pubkeyEncrypt(
      prefix0.strinifyPrivateKey(kp.privateKey), serverPub, "test test");
  print(enc);
  print('pub: ${prefix0.strinifyPublicKey(kp.publicKey)}');
}
0
likes
110
pub points
64%
popularity

Publisher

unverified uploader

Encrypt and decrypt data use SM2, This is the High level API build amount pointycastle, specify Elliptic curve to SM2 can simplify the api.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (LICENSE)

Dependencies

base58check, hex, pointycastle

More

Packages that depend on sm2cipher