Is Java Cryptography standard libraries in Android run as native code

有些话、适合烂在心里 提交于 2019-12-13 10:26:16

问题


I am integrating standard java cryptography classes in my Android application, but I noticed that the AES algorithm is not that fast, it cannot encrypt more than about 5 Kb per second, so do someone know if I can get more performance if I implement my own cryptography methods using NDK? or it is just being done already in the standard library? any suggestions is appreciated


回答1:


Is Java Cryptography standard libraries in Android run as native code

On older devices, javax.crypto is implemented in Java code. Starting in Android 4.3 or 4.4, Android uses an OpenSSL-based javax.crypto provider, so most of the code will be native.

so do someone know if I can get more performance if I implement my own cryptography methods using NDK?

If by "implement my own cryptography methods", you mean "link to and use libcrypto", that may be faster on older devices, but I would not expect much difference on newer devices.



来源:https://stackoverflow.com/questions/37410357/is-java-cryptography-standard-libraries-in-android-run-as-native-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!