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

[v5.0.3][Web] decrypt incorrect #334

Open
zs-dima opened this issue May 14, 2024 · 6 comments
Open

[v5.0.3][Web] decrypt incorrect #334

zs-dima opened this issue May 14, 2024 · 6 comments

Comments

@zs-dima
Copy link

zs-dima commented May 14, 2024

decrypt incorrect in case of Web release.
the same code decrypt correctly in the debug or encrypt v5.0.1

final key = Key.fromUtf8("key");
final initializationVector = IV.fromLength(16);
final encrypter = Encrypter(AES(key, mode: AESMode.cbc, padding: 'PKCS7'));
return encrypter.decrypt64(this, iv: initializationVector);

Flutter 3.16.4
encrypt v5.0.3

@tipu0710
Copy link

tipu0710 commented May 18, 2024

Facing same issue on web. I'm using encrypt: ^5.0.3. It was working well before. Here is my code.

final _encrypter = Encrypter(
   AES(Key.fromUtf8('key')),
 );
 static final _iv = IV.fromLength(16);
String encrypt(String value) {
   final encrypted = _encrypter.encrypt(value, iv: _iv);
   return encrypted.base64;
 }

String decrypt(String value) {
   var decrypt = _encrypter.decrypt64(value, iv: _iv);
   return decrypt;
 }

@ArslanKhan99
Copy link

Same issue encryption is also wrong as when going to decrypt it its give symbols in return

@ArslanKhan99
Copy link

THIS ID DECRYPTED Value. This is printing console as it was working fine earlier �����Pl��fY�#��~675

@ArslanKhan99
Copy link

It is encryption seems okay but its also wrong because when try to decrypt it on server side it gives the same decrypt show above "x1kNa/Tk0yH13GhvwmfRGirqGqBFxOt03zqWOf5A6WQ="

@wsk321
Copy link

wsk321 commented May 30, 2024

I encountered this issue today, and after reverting to version 5.0.0, it no longer appeared. I hope the author can address this issue for versions post 5.0.0.

@ArslanKhan99
Copy link

the old version was not longer available I sort this issue like below

get version 5.0.1 directory from my pub cached.
update the project according to my project and use this as local dependency its worked now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants