Closed SimonQiu-bj closed 7 months ago
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:encrypt_shared_preferences/src/crypto/aes.dart': Failed assertion: line 7 pos 12: 'key.length == 16': is not true.
i didn't set the _key
Hi, you should set key 16 length(128 bit) to fix this issue, or you can implement your own encryption algorithm using IEncryptor
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:encrypt_shared_preferences/src/crypto/aes.dart': Failed assertion: line 7 pos 12: 'key.length == 16': is not true.
0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
2 AESEncryptor.encrypt (package:encrypt_shared_preferences/src/crypto/aes.dart:7:12)
3 SharedPreferencesDecorator.save (package:encrypt_shared_preferences/src/shared_preferences_decorator.dart:157:30)
4 SharedPreferencesDecorator.setString (package:encrypt_shared_preferences/src/shared_preferences_decorator.dart:151:12)
5 EncryptedSharedPreferences.setString (package:encrypt_shared_preferences/src/enc_shared_pref.dart:63:23)
6 main (package:zz_yun_system_manager/main.dart:9:20)