简体   繁体   English

在Android中的应用层实现加密

[英]Implementing Encryption in application layer in Android

I want to provide security features in an application communicating via open wifi's by implementing application level encryption. 我想通过实现应用程序级加密,在通过开放wifi进行通信的应用程序中提供安全功能。 The wifi may be used by other users, or application, but the data transmitted or received for that particular application should be encrypted. wifi可以由其他用户或应用程序使用,但是应该加密为该特定应用程序发送或接收的数据。 How do I achieve this? 我该如何实现这一目标? Are there any specific libraries in Android I can use to achieve this? 我可以使用Android中的任何特定库来实现此目的吗?

In general, you can use SSL/TLS (for stream-based communications) and DTLS (UDP-based variant of TLS) to secure your communication and avoid reinventing the wheel. 通常,您可以使用SSL / TLS(用于基于流的通信)和DTLS(基于UDP的TLS变体)来保护您的通信并避免重新发明轮子。 Contrary to the popular belief, TLS does not require X.509 certificates -- TLS supports many authentication mechanisms including OpenPGP, shared keys and more. 与流行的看法相反,TLS不需要X.509证书 - TLS支持许多身份验证机制,包括OpenPGP,共享密钥等。 Not many libraries support those mechanisms though (our SecureBlackbox does). 虽然没有多少库支持这些机制(我们的SecureBlackbox确实如此)。

Encrypting the data on-the-go without TLS is also possible, of course, but again it's a good idea to avoid implementing your own. 当然,在没有TLS的情况下加密数据也是可能的,但同样最好避免实现自己的数据。 In this case OpenPGP encryption would be very handy - it supports password-based as well as key-based encryption. 在这种情况下,OpenPGP加密非常方便 - 它支持基于密码和基于密钥的加密。

如果你想保护android和你的后端服务之间的通信,你可以通过https使用soaprest webservices。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM