n3s0 || journal

Generating A QR Code For Easy Access To Wireless

Posted on 3 mins

Netadmin

Summary


Sometimes I need to allow access to my wireless networks. It’s not common. But, it happens from time to time. With that being so. It can be difficult for others to read handwritting. Sometimes it can be stressful for others to get on the wireless network. So, in a general home setting, coffee shop, AirBnB, Hotel, etc. This method can prove useful and hastle free.

There is a way to allow phones to add wireless networks. From my understanding with phones you can use a MeCard-like format with a QR Code. Whoever wants to connect to the wireless they just open the camera app on their phone and it will just add the Wifi MeCard profile to the phone.

Wifi MeCard Format

The format looks somethng like this. It indicates that it’s a wireless network with WIFI. The S indicatea the name of the SSID. The T indicates the authentication protocol being used. The P indicates the password or PSK. I generally leave H blank. It inidicates that the network is hidden. This is also optional in the format as long as there are two semi-colons at the end of it.

WIFI:S:<SSID>;T:<WEP|WPA|WPA2|nopass>;P:<PASSWORD>;H:<true|false|blank>;;

Another example of the format as seen on some forums that I’ve found.

WIFI:T:<authentication>;S:<yourSSID>;P:<yourpassword/PSK>;H:<true/false>;

Setup

Generally I put in something like this with the wireless networks information in it.

WIFI:T:WPA2;S:ExampleSSID;P:Password3xample;;

After putting this into a file. You can use the following command to take the ouput and generate a QR code to the terminal.

cat wifi.txt | qrencode -t ansiutf8

This will generate the following output from the command to the terminal. This can also output PNG files of the QRCode so if you want to print off stickers at home and put them somewhere; like a magnet or on your fridge. You can. Simple as that.

Although, I don’t recommend it. This image can be sent to a print on demand sticker printing business if termal printers aren’t availble.

█████████████████████████████████████
█████████████████████████████████████
████ ▄▄▄▄▄ █ ▄▄ ███▄▄▄█▄██ ▄▄▄▄▄ ████
████ █   █ ██▄█▀▀▄ ▀▀▄██ █ █   █ ████
████ █▄▄▄█ █ ▀▀▄ ▀█ █▀  ██ █▄▄▄█ ████
████▄▄▄▄▄▄▄█ ▀▄█▄█ █ ▀▄█ █▄▄▄▄▄▄▄████
████▄ ▄██ ▄█▄▄█▄  ▀█▄▄▀▄▀ ▄▄ ▀█  ████
████▄█▀▄█ ▄ █▄ ▀ ▄█▄█▄██  ▄ ▀ █▀▀████
████▄█▄█▀█▄ ▄  ██  ██ ▄▄▀▀▄  ▀▀▄▀████
████▀▄▄▀▄█▄█▀██▄██ █ ▀█▄██▀ ▄ ▀▀▄████
█████▀▄ ▄▀▄█ █▄▄   █▀▄ ██ ▄▀  ██ ████
████▄▄▄▄ █▄ ▄▀█▀ ▄ ▀█▄█ █▄█ ▀ ▄  ████
████▄▄██▄█▄▄ █▀█▄ ██▀  ▀ ▄▄▄  ▀ █████
████ ▄▄▄▄▄ █▀▀▄▄▄▀██▀▄▄▄ █▄█ ██▀█████
████ █   █ ███ ▄▄ ██▀ ▀▄▄ ▄▄▄▄ █▄████
████ █▄▄▄█ █ █▀▀▄▀██  █▀██ ███▄▄ ████
████▄▄▄▄▄▄▄█▄▄▄▄▄▄███▄██▄██▄█▄▄▄▄████
█████████████████████████████████████
█████████████████████████████████████

If you prefer not to output this to the terminal. The following command will output this to a PNG file. Which may make it more printer or document friendly.

cat wifi.txt | qrencode -o wifi.png -t PNG