rsa_cipher 1.2.2 copy "rsa_cipher: ^1.2.2" to clipboard
rsa_cipher: ^1.2.2 copied to clipboard

rsa_cipher is a powerful and easy-to-use package for RSA encryption and decryption in Dart.

example/rsa_cipher.dart

import 'package:rsa_cipher/rsa_cipher.dart';

void main() async {
  // generate key
  final keyPair = RsaCipher().generateKeyPair();

  // encode key to pem
  final publicKeyPem = keyPair.publicKey.toPem();
  final privateKeyPem = keyPair.privateKey.toPem();

  // decode pem to key
  final publicKey = PublicKey.fromPem(publicKeyPem);
  final privateKey = PrivateKey.fromPem(privateKeyPem);

  // encrypt text
  final cipherText = RsaCipher().encrypt(
    plaintext: "hello",
    publicKey: publicKey,
  );

  // decrypt text
  final plainText = RsaCipher().decrypt(
    ciphertext: cipherText,
    privateKey: privateKey,
  );
}
1
likes
160
points
79
downloads

Publisher

verified publisherwolfscream.com

Weekly Downloads

rsa_cipher is a powerful and easy-to-use package for RSA encryption and decryption in Dart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

asn1lib, flutter, pointycastle

More

Packages that depend on rsa_cipher