Python 3 tool to generate hexkey for ifconfig in OpenBSD.
Command ifconfig(8) is used in OpenBSD to configure network interfaces. For WLAN (IEEE 802.11 specifications) with WPA key, the key can be given using a full length hex key. This hexkey toll can generate that hex key from these three inputs:
- wireless interface (that's only needed for printing complete ifconfig command)
- network ID (ESSID)
- WPA key (passphrase to access network above)
As regular user:
- edit
hexkey.py
and fill in variables interface, nwid and passphrase - run
hexkey.py
, which will print ifconfig command including generated hex key
- printed command is using doas(1) (successor to sudo) to execute command as root
- make sure, that passphrase and/or hex key can't be seen by surrounding
Code has been checked for code style via
pycodestyle --show-source --show-pep8 hexkey.py