ecc_encryption 0.0.2
ecc_encryption: ^0.0.2 copied to clipboard
Elliptic curve cryptography functions in Dart. Private Key, Public Key, Encryption, Decryption
example/ecc_encryption_example.dart
import 'package:ecc_encryption/ecc_encryption.dart';
void main(){
ECCEncryptionSample().getKeys();
}
class ECCEncryptionSample {
ECC ecc = ECC.initialise(wifPrivateKey: 'KwcZLfpPXciZeqY9gR73yMzgZag4TSw3ekhyF1rstzeyi7kWnMTV');
getKeys(){
print('Private Key: ${ecc.privateKey}');
print('Public Key: ${ecc.publicKey}');
encrypt();
}
encrypt(){
String message = 'Hello World';
String? encrypted = ecc.encrypt(data: message);
print('Encrypted: $encrypted');
print('Decrypted: ${decrypt(encrypted ?? '')}');
}
decrypt(String message){
return ecc.decrypt(data: message);
}
}