pubkeyEncryptRaw static method

Map<String, dynamic> pubkeyEncryptRaw(
  1. String privateString,
  2. String publicString,
  3. Uint8List data
)

Implementation

static Map<String, dynamic> pubkeyEncryptRaw(
  String privateString,
  String publicString,
  Uint8List data,
) {
  final secretIV = byteSecret(privateString, publicString);
  final secret = Uint8List.fromList(secretIV[0]);
  final iv = Uint8List.fromList(secretIV[1]);
  Salsa20Engine _cipher = Salsa20Engine();
  _cipher.reset();
  _cipher.init(true, _buildParams(secret, iv));
  final Uint8List encData = _cipher.process(data);
  return {'enc': encData, 'iv': convert.base64.encode(iv)};
}