简体   繁体   中英

Encrypt traffic with VpnService

I've searched for a solution for 2 days. The problem is: i need to create the app for encrypting (with some custom algorithm) all internet traffic from a device. I've found that I can use vpn and android provides me a class VpnService . I don't understand how to encrypt the tcp packets with VpnService class.

Could anyone help me please?

By using VpnService, you can get all the IP packet routed to your interface. What you get here, is IP packet, which takes TCP/UDP packet as payload. The the IP packet should be tunneled to remote server. Encrypt the traffic with remote server is what you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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