crypto_x 0.0.1 crypto_x: ^0.0.1 copied to clipboard
Advanced RSA based on pointycastle
crypto_x #
Advanced RSA based on pointycastle.
Features #
- RSA with PKCS1 and OAEP encoding.
- OAEP only supports encryption with public key and decryption with private key. For details, see OAEPEncoding
Getting started #
Add the package to your pubspec.yaml
:
dependencies:
crypto_x: <latest_version>
Usage #
var privateRSA = RSA(
privateKey: 'privatePKCS8Key');
var publicRSA = RSA(
publicKey: 'publicPKCS8Key');
CryptoSignature signature = privateRSA.encrypt(PlainBytes.fromString('hello world'), usePublic: false);
String ciphertext = signature.base64;
PlainBytes plainBytes = publicRSA.decrypt(signature);
String plainText = plainBytes.toString();