rsa_util

rsa util

Getting Started

import 'package:rsa_util/rsa_util.dart';

const s = "This is a test by RSA 123456 !"; //the s length limit 127

List keys = RSAUtil.generateKeys(1024);

final String pubKey = keys0;

final String priKey = keys1;

RSAUtil rsa = RSAUtil.getInstance(pubKey, priKey);

var jiami = rsa.encryptByPublicKey(s);

print("公匙加密" + jiami);

var jiemi = rsa.decryptByPrivateKey(jiami);

print("私匙解密" + jiemi);

var jiami2 = rsa.encryptByPublicKey(s);

print("私匙加密" + jiami2);

var jiemi2 = rsa.decryptByPrivateKey(jiami);

print("公匙解密" + jiemi2);

Libraries

fixed_secure_random
rsa_util