encryptString function

String encryptString(
  1. String source,
  2. String masterPassword
)

Implementation

String encryptString(String source, String masterPassword) {
  final key = buildKey(masterPassword);
  final iv = buildIV(masterPassword);

  final encrypter = encrypt.Encrypter(encrypt.AES(key));
  final encrypted = encrypter.encrypt(source, iv: iv);

  return encrypted.base64;
}