Android AES 解密速度慢
我正在构建一个 Android 应用程序,需要aes 解密一个非常大的包(~50Mb),并且在 android 内置的 aes 解密机制中实现时非常慢(大约 5 分钟)。
基于 SO 中的上述帖子,我尝试使用 ndk 并尝试下载本机库(openssl)以用于此应用程序。但是,openssl for android 有大量文件,我不知道使用哪些文件来创建 .so 文件。
我对在 Android 应用程序中使用 ndk 和本机代码非常缺乏经验,并且会发现有关如何使用 openssl 库进行 aes 解密的任何建议/示例代码非常有用。
提前致谢, 纳文
Ref: Android encryption/decryption issue (AES)
I am building an android app which requires aes decryption of a really large package (~50Mb) and it is really slow when implemented in android's inbuilt aes decryption mechanism (around 5 minutes).
Based on the above posts in SO, I attempted to use ndk and tried to download native libraries (openssl) to use for this app. However, openssl for android has a really large number of files and I do not know which ones to use to create the .so file.
I am quite inexperienced with the use of ndk and native code in android apps and would find any suggestions/sample code on how to use openssl library for aes decryption really useful.
Thanks in advance,
Naveen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试 SpongyCastle 它是一个重新打包的 BouncyCastle,不会与 Android 发布的版本发生冲突。 Android 系统上的版本比较旧(如果您有包含它的 Android 版本)。
这应该就是您所需要的。
Try SpongyCastle its a repackaged BouncyCastle that wont conflict with the one released with Android. The one on Android systems is old (if you even have a release of Android that includes it).
This should be all you need.
我和纳文面临着同样的问题。
我确实对海绵城堡有一些疑问。如果我错了请纠正我。
我发现这篇文章: http://www. coderanch.com/t/134504/Security/Bouncy-Castle-vs-Sun-JCE
看起来性能可能可以忽略不计。虽然它没有具体提到 spongycastle.bouncycastle 但我假设是这样,因为 sun jce 的加密库使用了 bouncy castle 的精简版本。
I'm facing the same issue as Naveen.
I do have some doubts regarding spongy castle. Correct me if i'm wrong.
This post i've found: http://www.coderanch.com/t/134504/Security/Bouncy-Castle-vs-Sun-JCE
Seems like performance might be negligible. Though it did not specifically mentioned about spongycastle.bouncycastle but i'm assuming it is, as sun jce's crypto library uses a stripped down version of bouncy castle.