2

Is it possible to check whether my Wi-Fi is secured(ie WPA2/WEP) programmatically in Windows C++?

Bart
  • 19,692
  • 7
  • 68
  • 77
  • Why would you want to do that? If you think that your app could refuse to use an unsecured WiFi, you miss the point of public/open WiFi using VPNs. – Didier Trosset Jul 29 '11 at 06:28
  • @Didier Trosset: I assume the question really means "...whether my _network connection_ is an unsecure WiFi". If you go via VPN, then although unsecured WiFi is the carrier, it's a different network connection. And while it's actually the user's fault if he runs applications that transmit sensitive data over public/open WiFi (what data except public websites is not sensitive, anyway), I can somewhat understand the OP's goodwilled attempt to protect the uncanny user from the most stupid vulnerability. Though "internet" as such isn't secure, there's still different "shades of grey". – Damon Jul 29 '11 at 09:04

1 Answers1

2

From what I recall this is possible through the native Wi-Fi API and especially via the WlanHostedNetworkQueryProperty() function when querying for the WLAN_HOSTED_NETWORK_SECURITY_SETTINGS.

Bart
  • 19,692
  • 7
  • 68
  • 77