0

I am using AES algorithm in Android for encryption and decryption. It is okay for small files but when I tried to decrypt a file approximately 70 mb I am waiting 2-3 minutes. Which algorithm should i use?

  • 1
    Can you show us your code for encryption/decryption? Perhaps there is improvements that can be made in your implementation. Do you need the entire file decrypted at once or could you accept a streaming solution? – Duncan Jones May 22 '14 at 11:34
  • @Duncan can we chat about this? – user3664795 May 22 '14 at 11:41
  • There was a [similar question](http://stackoverflow.com/questions/23512321/encryption-and-decryption-for-large-files-takes-too-much-time-in-android) recently. You should try the same suggestions - measure how much time it takes to copy 70mb file using a cycle over input and output streams. It is possible that encryption is not the main bottleneck here. – Oleg Estekhin May 22 '14 at 12:06
  • Which mode of operation did you use? – Nayef May 27 '14 at 05:00

1 Answers1

0

I don't know if there is an algorithm that will make a difference in terms of the time it takes to encrypt/decrypt a file of that size.

But you can always try an approach of splitting the file and encrypt/decrypt each part separately where you can use some asynktasks to do it in "parallel".

For example you can have 7 files of 10MB each. You decrypt the 7 parts in paralel and stick them together after the decryption.

If you still want to have one physical file, you can put the encrypted separate parts in a zip file and extract them when you need to decrypt.

Juan
  • 5,525
  • 2
  • 15
  • 26