I want to make a little fun with some guests that are using my guest wpa2 wifi.
I want to set the password to special characters and watch them failing.
The manual says If a 64-character hexadecimal string is supplied, it will be used directly as the pre-shared key instead. So I opened the /etc/config/wireless and changed the line to:
option key '41414141414141410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
41 is hex for A, so the password should be 'AAAAAAAA'. But after a wlan restart, the wifi dont come up. In the OpenWRT Gui, the password is marked red. Only if I change the PW back to a normal string PW, the wifi come up.
My guess is that you'd need to write '000000....0004141414141' in order to mean AAAAAA and not AAAAA00...00
My question is why do you need to use the hex value there?
Also please refrain from signing your posts as per rules.
41 is two hexadecimal characters. Yes they do represent the ASCII characters A but still count as two hex characters. Similarly 00 are two hex characters representing NULL
With the populated characters nearer the 0x0 place
I'm also curious, since the users type in the translated passphrase anyways. You're the only person able to see Hex entered in the config - instead of the passphrase.
The password is still not AAAAAAAA.
If I remove the enclosing quotes (') then they are added after a restart of the wifi.
I remember that there where a problem typing german umlauts in the wifi password. Maybe because of different encodings (umlauts in utf8 and the upper 8bit ascii table [codepage 850?]). Are there still such problems known for Android or iPhone devices? If not I want to try some chars that are not reachable by a english or german keyboard. Therefor I must use hex.
Most user devices do not support entering a pre-hashed key. A pre-hashed key needs to be in hex and exactly 256 bits (64 hex characters) long. It is used directly in binary format in the encryption system.
Pre-hashing the key will slightly reduce startup time on devices with a slow CPU, since the hashing step can be skipped. Other than that there is no reason to do it.
The utility program wpa_passphrase can be used to hash a text passphrase.
The reason for hashing the key is to make it more difficult to brute-force guess the passphrase. In order for this measure to be effective the SSID needs to be something unique and not found in a pre-hashed "rainbow table" of common SSIDs and dictionary passphrases.