encryptString static method
encrypt the string and prefix the value with '\u001Bpw:' so it's compatible with old plain text password
Implementation
static String encryptString(String str) {
if (str == '') {
return '';
}
_encryptEngine?.reset();
_encryptEngine?.init(true, _encryptParams!);
var utf8bytes = Uint8List.fromList(utf8.encode(str));
var block = Uint8List((utf8bytes.length + 31) ~/ 32 * 32);
block.setRange(0, utf8bytes.length, utf8bytes);
return '\u001Bpw:${Base64.encode(_encryptEngine!.process(block))}';
}