2

I'm developping an app which may send sensitive data and I want to be sure that i don't send them on a public or weak protected network. That's why I'd like to get the current security used on wifi network on Android.

I found this post but I'm not sure of the accuracy of the solution. Indeed, the allowedKeyManagement method seems to return the supported protocols, but it's not explicitely said to return the current active protocol beeing used. Is there a sure way to get the effective protection used on the cirrent wifi network ?

Thanks

Community
  • 1
  • 1
lemon
  • 25
  • 4
  • WPA is not enough if the hacker/interested party is inside the network - http://security.stackexchange.com/questions/12596/can-a-hacker-sniff-others-network-data-over-a-wireless-connection – Machinarius Aug 05 '14 at 15:25
  • Thank you for your answer; the fact is that i just want to be sure that the device is using a protected network (preferably WPA2) to increase mitigation of risks. If a method could just return safely and securely the exact protection used currently it would be really useful to perform what i'd like. – lemon Aug 05 '14 at 16:03

1 Answers1

0

I can suggest one method

  1. Get list of all configured network using getConfiguredNetworks API
  2. Loop through all entries and find the current Network using WifiConfiguration.status API. The status should be CURRENT for current network
  3. For that current network, get the allowedKeyManagement and check that it is not NONE.
vishalm
  • 477
  • 5
  • 12
  • Thanks for your answer; but the documentation says "The set of key management 'protocolS' supported by this configuration". I read quite much posts relating to Android developpement and many developpers complain about mistakes in the doc; so would it be possible that this is actually a typo and the method returns only the current used ciphering, instead of the supported ones ? – lemon Aug 05 '14 at 15:57
  • In that case, it still solves your problem right? you can check if current cipher matches your needs and take action accordingly – vishalm Aug 06 '14 at 22:36
  • It doesn't solve the problem, e.g. : if the configuration allows WPA and WEP, how can I be sure that the network currently used between the device and the the access point is protected thanks to WPA and not WEP ? – lemon Aug 07 '14 at 14:29
  • I think you might have this issue with [virtual SSIDs](http://en.wikipedia.org/wiki/DD-WRT#Version_history) ? – lemon Aug 11 '14 at 07:53