.\" $OpenBSD: wpa-psk.8,v 1.3 2010/08/27 07:50:38 jmc Exp $ .\" .\" Copyright (c) 2008 Damien Bergamini .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate: August 27 2010 $ .Dt WPA-PSK 8 .Os .Sh NAME .Nm wpa-psk .Nd passphrase to WPA pre-shared key mapping .Sh SYNOPSIS .Nm .Ar ssid .Ar passphrase .Sh DESCRIPTION .Nm generates a 256-bit pre-shared key from a service set identifier (SSID) and a passphrase. The passphrase must be a sequence of between 8 and 63 ASCII-encoded characters. The length of the SSID must be between 1 and 32 octets. .Pp .Nm prints the generated pre-shared key to stdout as a series of 64 hexadecimal digits preceded by .So 0x Sc . The output is intended to be passed to .Xr ifconfig 8 via the .Cm wpapsk option. The .Ar ssid parameter should be the same as the .Ar nwid parameter passed to .Xr ifconfig 8 via the .Cm nwid option. .Pp To generate the pre-shared key, .Nm uses the Password-Based Key Derivation Function 2 (PBKDF2). The passphrase is hashed 4096 times using HMAC-SHA1. .Sh SEE ALSO .Xr ifconfig 8 .Rs .%R IEEE Std 802.11i .%T Medium Access Control (MAC) Security Enhancements .%D 2004 .Re .Rs .%R PKCS #5 v2.0 .%T Password-Based Cryptography Standard .%D 1999 .Re .Rs .%R RFC 3174 .%T US Secure Hash Algorithm 1 (SHA1) .%D 2001 .Re