Speed up encryption/decryption?

后端 未结 5 1605
后悔当初
后悔当初 2020-12-09 14:20

I have an encryption and decryption code which I use to encrypt and decrypt video files (mp4). I\'m trying to speed up the decryption process as the encryption one is not th

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-09 14:35

    Consider using the NDK. On devices before Froyo (and even Froyo itself), it would be really slow due to the lack of JIT (or a very simple one in Froyo). Even with the JIT, native architecture-optimized crypto code will always outrun Dalvik.

    See also this question.

    As an aside, if you're using AES directly, you're probably doing something wrong. If this is part of an effort to do DRM, make sure you realize the full extent of the fact that decompiling an Android app is trivial. Your key will not be secure, which by definition defeats the encryption.

提交回复
热议问题