I\'m trying to encrypt image files on Android with password based encryption. To save the encrypted image I just do this:
FileOutputStream fos = new FileOutp
When writing to a CipherOutputStream, make sure you close()
the stream after writing the data (and not closing the underlying stream before it). Closing makes sure the right padding is added. A flush()
alone is not enough here.
Also, I would advise to not use DES for new protocols - preferred nowadays is AES.
You could subclass CipherOutputStream or even just OutputStream, and just override the flush() method to do nothing.