encryptAesGcm128 method

Future<String> encryptAesGcm128(
  1. String plainText,
  2. String key,
  3. String nonce
)

Encrypt data by AES algorithm with GCM mode, and return a base64 encoded encrypted string

plainText is the string to be encrypted.

key the key string, the length of it should be 128bits(16 bytes)

nonce the base64 encoded nonce string, the length of it should be 92bits(12 bytes), which can be generated by generateNonce() method

Implementation

static Future<String> encryptAesGcm128(
        String plainText, String key, String nonce) async =>
    await _channel.invokeMethod("Encrypt_AesGcm128", {
      "data": plainText,
      "key": key,
      "nonce": nonce,
    });