本文介绍了在Android基础的加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过的例子这里。一切都很好,我理解它,但是它依赖于供应商的bounceycastle库。我不想捆绑任何额外的第三方库与我的应用程序,如果我能帮助它。我不需要诺克斯风格的堡垒安全性,通过导线传输只是一些基本的对称加密。我该怎么做基本的加密Android上使用了第三方库?

I have seen the example here. All well and good and I understand it, however it relies on the bounceycastle library for the provider. I don't want to bundle any additional third party libraries with my app if I can help it. I don't need fort knox style security, just some basic symmetric encryption for transmitting over the wire. How can I do basic encryption on Android with out third party libraries?

感谢

推荐答案

那么BouncyCastle的是包含在Android中,你可以看到,如果你会尝试把它列入你会得到: D / dalvikvm(9268 ):DexOpt:未验证Lorg / BouncyCastle的/ X509 /推广/ SubjectKeyIdentifierStructure;':多重定义

Well BouncyCastle is included in Android, as you can see if you would try to include it you would get: D/dalvikvm( 9268): DexOpt: not verifying 'Lorg/bouncycastle/x509/extension/SubjectKeyIdentifierStructure;': multiple definitions and so on.

然而,并非所有的算法中实现 - 你会得到一个抛出:NoSuchAlgorithmException。在Android 2.2的我发现这些即将实施:

However, not all algorithms are implemented - you would get an NoSuchAlgorithmException.In Android 2.2 I found these to be implemented:

PBEWITHSHAAND128BITAES-CBC-BCPBEWITHSHAAND3-KEYTRIPLEDES-CBC1.2.840.113549.1.1.7PBEWITHSHA256AND256BITAES-CBC-BCPBEWITHSHAAND192BITAES-CBC-BCDESEDEDES1.2.840.113549.3.7PBEWITHSHAAND2-KEYTRIPLEDES-CBC1.3.14.3.2.7PBEWITHSHA256AND192BITAES-CBC-BCPBEWITHSHAAND256BITAES-CBC-BCPBEWITHSHAAND40BITRC2-CBCAES2.16.840.1.101.3.4.1.42PBEWITHSHA256AND128BITAES-CBC-BC2.16.840.1.101.3.4.1.222.16.840.1.101.3.4.1.2

PBEWITHSHAAND128BITAES-CBC-BCPBEWITHSHAAND3-KEYTRIPLEDES-CBC1.2.840.113549.1.1.7PBEWITHSHA256AND256BITAES-CBC-BCPBEWITHSHAAND192BITAES-CBC-BCDESEDEDES1.2.840.113549.3.7PBEWITHSHAAND2-KEYTRIPLEDES-CBC1.3.14.3.2.7PBEWITHSHA256AND192BITAES-CBC-BCPBEWITHSHAAND256BITAES-CBC-BCPBEWITHSHAAND40BITRC2-CBCAES2.16.840.1.101.3.4.1.42PBEWITHSHA256AND128BITAES-CBC-BC2.16.840.1.101.3.4.1.222.16.840.1.101.3.4.1.2

这篇关于在Android基础的加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 04:22