Creating QR code for wireless networks
QR-Codes
A quick solution to bring a mobile phone into a wireless network is via QR Code.
On the internet there are a lots of QR code generator web sites available, but my problem with those is that I do not know what happens with the data I enter.
By looking for a “secure” solution I came across qrencode, which is running on Linux.
qrencode can be easily installed on a Debian Linux system by using the command below:
#apt install qrencode
WiFi SSID
For a WiFi SSID, qrencode expects a string in a specific format, which looks like this:
WIFI:S:Apple-Sucks;T:WPA;P:secret1234;H:true;;
S = Wireless SSID
T = Encryption
P = Password
H = true if SSID is hidden
To generate the QR code I’m using this command, which writes the output in a PNG image (-o). As error correction level I’m using high, which allows 30% destruction of the QR code (-l H).
$qrencode -o wifi.png -l H "WIFI:S:Apple-Sucks;T:WPA;P:secret1234;H:true;;"
MeCard
It’s also possible to share contact details via QR code, in this case the format is MeCard. The string in this case can look like this:
MECARD:N:Stefan Thierolf;ORG:thierof.org;TEL:+49 123 456 789;URL:https\://thierolf.org;EMAIL:hello@thierolf.org;ADR:Musterstrasse 1, 12345 Musterstadt, Germany;;
N = Name
ORG = Organization
TEL = Phone Numbers
URL = Web sites
EMAIL = Email address
ADR = Street address, postal code
The command to write a MeCard would look like this.
$qrencode -o mecard.png -l H "MECARD:N:Stefan Thierolf;ORG:thierof.org;TEL:+49 123 456 789;URL:https\://thierolf.org;EMAIL:hello@thierolf.org;ADR:Musterstrasse 1, 12345 Musterstadt, Germany;;"
QR code scanner
To scan QR codes on my mobile phone, I’m using the Privacy Friendly QR-Scanner App from KIT (Karlsruher Institut für Technologie) because I personally value privacy and data protection. This app does not have any advertisements or shares data with doubtful companies like facebook (via a dubious API for example).