simple_rsa
simple_rsa copied to clipboard
FormatException: Bad UTF-8 encoding 0x81 (at offset 1)
hello,thanks for your open source。 I have some problems when use the package. eg:
-
String phone=await encryptString("12345678910", Utils.rsakey);
When used in this way, the decryption result is not correct. -
String phone=await encryptString("12345678910", utf8.decode(base64.decode(Utils.rsakey)));
When used in this way, it can't run and the console reported the following error :FormatException: Bad UTF-8 encoding 0x81 (at offset 1)
development environment:
vscode flutter version: 1.0.0+1 dart environment: sdk: ">=2.0.0-dev.68.0 <3.0.0"
Check out this https://github.com/giandifra/simple_rsa/issues/5#issuecomment-464449870, might be helpful.
final encryptedText = await encryptString(asekey,utf8.decode(base64.decode(encryptionHelper.mPublicKey))); Same as yours, my publishkey is a string without '-----BEGIN PUBLIC KEY-----' and '-----END PUBLIC KEY-----', it can't run and the console reported the following error : Unhandled Exception: FormatException: Bad UTF-8 encoding 0x81 (at offset 1)
$ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 6.1.7601], locale zh-CN) [√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [√] Android Studio (version 3.5) [√] Connected device (1 available)