-
Notifications
You must be signed in to change notification settings - Fork 135
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
Decrypt a file in dart is taking an eternity to decrypt #126
Comments
Why do you say Dart is not suited for this? I don't want to sound rude or anything, I am curious, I am just beginning with Dart (with Flutter), and want to learn. Actually, I have just tested it with https://pub.dev/packages/cryptography and while this lib (but really PointyCastle) took 40 seconds for a 1.3 mb image (encryption and decryption alike, using AES-CBC-256), the 'cryptography' takes about 50ms. I am astonished, but can verify the the encrypted / decrypted data is correct (I'm comparing against sample data from yet another, C++ based, library). |
How cool, there is a great alternative then, nice! |
Hey @wujek-srujek , i would be really greatful if you could share that encryption that you did with the Cryptography package, i too want to implement that, because, i am afraid to say, the encrypt package does encrypt files very slowly, i tested it for a pdf file of size 12.3 mb and that took 9-9.5 minutes from reading and writing, i tested that read/write only took about < 1.5 secs. I am a newbie to encryption and really would be grateful if you share some insights on how you acheived it with cryptography package. Thank you. |
Hi @namangor04 , as far as I remember (I don't have the code any more) I didn't do anything special, just followed the docs, you can see an example here: https://pub.dev/documentation/cryptography/latest/cryptography/AesCbc-class.html. Note: you should probably use AES-GCM (the example above is AES-CBC) as it is more secure, but I specifically needed to use CBC. |
Hi @wujek-srujek , thank you for your response, I did implement that as you said, with AES-GCM and it works like a charm, thank you for your assistance. Really Appreciate your assistance. I tested it out and was able to read, encrypt, decrypt, save the same file in <7 seconds. I would still use this package for strings maybe, but thank you for your assistance brother, you saved me a lot of time (as I am on a tight 5 day deadline for the current project). |
Give this simple scenario...
This is taking more than 10 minutes to decrypt !
For comparison effect, I wrote this very same code using nodeJS and this took just miliseconds.
The text was updated successfully, but these errors were encountered: