Take the 2-minute tour ×

I want to develop an Android app for encrypting and decrypting large files (~500Mb) with RSA and some symmetric encryption algorithms. How can I achieve this? What is the best solution to use on devices with just a few MB RAM?

Regards Bobby

share|improve this question
would love to hear an answer on this :) –  Dheeraj Bhaskar Jan 22 '13 at 23:51
add comment

2 Answers

up vote 6 down vote accepted

CipherInputStream and CipherOutputStream let you use streams for encryption/decryption. This should let you deal with large file sizes without too many issues with memory. Sounds like you're already going down the right path with a combination of symmetric and asymmetric algorithms as RSA alone won't handle a large block of data.

share|improve this answer
add comment

Maybe you want to look at breaking up the file into chunks of smaller data and encrypting it accordingly.

See: encrypting and/or decrypting large files (AES) on a memory and storage constrained system, with "catastrophe recovery"

I not sure of your requirement but another way, is don't encrypt on the device! Just store the keys on the device and your backend does the heavyduty work but it needs to get the key from the device in order to decrypt, which is where your Android app will handle the sending part.

share|improve this answer
add comment

Your Answer


