Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use package in my app. Get this error. #7

Closed
SimonQiu-bj opened this issue Apr 25, 2024 · 2 comments
Closed

use package in my app. Get this error. #7

SimonQiu-bj opened this issue Apr 25, 2024 · 2 comments
Labels
question Further information is requested

Comments

@SimonQiu-bj
Copy link

[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)

@SimonQiu-bj
Copy link
Author

i didn't set the _key

@xaldarof
Copy link
Owner

xaldarof commented Apr 25, 2024

Hi, you should set key 16 length(128 bit) to fix this issue, or you can implement your own encryption algorithm using IEncryptor

@xaldarof xaldarof added the question Further information is requested label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants