Android AES-128 encryption/decryption of file is very slow. How can I increase the speed

前端 未结 2 2047
遇见更好的自我
遇见更好的自我 2021-02-03 15:29

I am developing an android app that secures images and videos like Vaulty and Keep safe. I am trying to use AES-128 encryption/decryption technique to store images and videos. I

2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-03 15:48

    Use a larger buffer as suggested by @MikeLaren, and also wrap the FileOutputStream in a BufferedOutputStream. When decrypting, wrap the FileInputStream in a BufferedInputStream. Or do both in both cases: no harm done.

    No need for heroic buffer sizes like a megabyte: 8k or 32k is sufficient.

提交回复
热议问题