simple_rsa3 2.0.2 copy "simple_rsa3: ^2.0.2" to clipboard
simple_rsa3: ^2.0.2 copied to clipboard

A plugin to make RSA encryption simple, right now it just only work on Android and ios.

Notice #

This package is a fork of the original simple_rsa package, all the credit is to their original authors. There was also simple_rsa2 which was a fork I maintained when I used to work at DevelSystems, but since the development of that one staled. I decided to fork it again, and bring this library back from the dead :).

Simple RSA Encryption #

Flutter plugin to encrypt, decrypt (RSA/ECB/PCSK1), verify and sign string with a public and a private key

Support for ANDROID and iOS(thanks to adlanarifzr)

Installation #

To use the plugin, add simple_rsa3 as a dependency in your pubspec.yaml file.

Usage #

First, initialize private and public key. Preferably in BASE64 format.

final publicKey = '...';
final privateKey = '...';

After that, you can encrypt or decrypt text

let simple_rsa3 = SimpleRsa3();
let plainText = 'something';
final encryptedText = await simple_rsa3.encryptString(plainText, utf8.decode(base64.decode(publicKey))) ?? '';
final decryptedText = await simple_rsa3.decryptString(encryptedText, utf8.decode(base64.decode(privateKey))) ?? '';

// Test
print(plainText == decryptedText ? 'true' : 'false');

Or you might want to sign and verify text

let simple_rsa3 = SimpleRsa3();
let plainText = 'something';
final signedText = await simple_rsa3.encryptString(plainText, utf8.decode(base64.decode(privateKey))) ?? '';
final verified = await simple_rsa3.verifyString(plainText, signedText, utf8.decode(base64.decode(publicKey))) ?? '';

// Test
print(verified ? 'true' : 'false');

Contributions #

Adlan Arif Zakaria (adlanarifzr) iOS compatibility, sign and verify method.

1
likes
150
points
1.39k
downloads

Publisher

verified publishercheley.dev

Weekly Downloads

A plugin to make RSA encryption simple, right now it just only work on Android and ios.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on simple_rsa3