Up until recently, it was a pain to defend againt WPA2 brute-force
by using a random 63-character password (the maximum in
mode). Thanks to Android and now iOS 11 supporting reading WiFi passwords
from a QR code, this is finally a practical defense.
Generating the QR code
After installing the
package, run the following:
qrencode -o wifi.png "WIFI:T:WPA;S:
for the name of your WiFi network and
the 63-character password you hopefully generated with
pwgen -s 63.
The only pitfall I ran into is that if you include a trailing newline character (for example piping
echo "..." into
qrencode as opposed to
echo -n "...") then it will
fail on both iOS and Android.
Scanning the QR code
On iOS, simply open the camera app and scan the QR code to bring up a
notification which allows you to connect to the WiFi network:
On Android, go into the WiFi settings and tap on the WiFi network you want
then click the QR icon in the password field and scan the code: