wpa_passphrase

Generate WPA pre-shared key from passphrase

TLDR

Compute WPA-PSK key reading passphrase from stdin
$ wpa_passphrase [SSID]
Compute WPA-PSK key with passphrase as argument
$ wpa_passphrase [SSID] [passphrase]
Generate and append to wpa_supplicant configuration
$ wpa_passphrase [SSID] [passphrase] >> /etc/wpa_supplicant/wpa_supplicant.conf

SYNOPSIS

wpa_passphrase ssid [passphrase]

DESCRIPTION

wpa_passphrase generates a WPA-PSK (Pre-Shared Key) configuration from an ASCII passphrase for a given network SSID. The output is in wpa_supplicant.conf format and can be appended to the configuration file.The tool pre-computes the PSK using PBKDF2, which is faster than having wpa_supplicant compute it each time. The output includes both the plain text passphrase (commented) and the computed PSK.

PARAMETERS

ssid

The network name (SSID) to generate the key for
passphrase
The WiFi password, must be 8 to 63 printable ASCII characters (read from stdin if omitted)

INSTALL

sudo apt install wpasupplicant
sudo dnf install wpa_supplicant
sudo pacman -S wpa_supplicant
sudo apk add wpa_supplicant
sudo zypper install wpa_supplicant
nix profile install nixpkgs#wpa_supplicant

CAVEATS

Providing the passphrase on the command line exposes it in process listings and shell history. For security, prefer reading from stdin. The passphrase must be between 8 and 63 characters. The SSID is case-sensitive and must match exactly. Part of the wpa_supplicant package.

SEE ALSO

wpa_supplicant(8), wpa_cli(8)