If you are using a headless setup for your Raspberry Pi, you can easily set up a wpa_supplicant.conf file to connect to wifi. But it is very important to mask your password for security reasons. In this post, I will show you how.

Your wpa_supplicant.conf file has network objects that look like this:

network={
ssid="testNetwork"
}

Where ssid is your network name and psk is your password. But you’ll notice that that is just a plain text password, which we all know is a no-no.

Use this command: wpa_passphrase [ssid-name] [password-name] and be sure to wrap the network and/or password in quotes if you have spaces in either.

This command will spit out a new network object that looks like this:

network={
ssid="testNetwork"