Datasheet
Sample Application Demonstrations
2013 Microchip Technology Inc. Preliminary DS52108A-page 45
4.5.9 Setup Source Code for WPA/WPA2
The MRF24WB0MA/B or MRF24WG0MA/B Wi-Fi
®
PICtail™ has the following two
approaches to run WPA/WPA2 security:
• On-the-fly PSK Calculation - The straight forward approach to supply the
passphrase. The PIC18/24/32 or PICtail will calculate the PSK based on the SSID
and the supplied passphrase. Due to the computationally intensive nature of this
operation, this will take approximately 30 seconds to 45 seconds to complete.
• Pre generated PSK - This approach is to provide the 32 byte PSK, and user can
directly plug this value into the source code.
The following section describes setting up and using both the preceding approaches:
4.5.9.1 ON-THE-FLY PSK CALCULATION
Only two pieces of information required to enable the MRF24WB0MA/B or
MRF24WG0MA/B Wi-Fi
®
PICtail™ to calculate the PSK and use that for the encryption
process, see Figure 4-15.
Define MY_DEFAULT_WIFI_SECURITY_MODE to be
WF_SECURITY_WPA_WITH_PASS_PHRASE or
WF_SECURITY_WPA2_WITH_PASS_PHRASE.
Define MY_DEFAULT_PSK_PHRASE.
FIGURE 4-15: SOURCE CODE CALCULATE PSK SETUP
Note that passphrase is case sensitive and spacing does matter.