I created a small program with runs command:
tshark -i2 -o wlan.enable_decryption:TRUE -o "uat:80211_keys:\"wpa-pwd\",\" Passphrase:SSID\"" -w test.pcapng
This creates the file test.pcapng, but it is not decrypted. I know from Wireshark docs that you cannot save decrypted file. You can only open it in Wireshark and provide wifi key or using that command and filter everything you want. Can I somehow read and decrypt on the fly using rdpcap because I created a very long program that uses rdpcap to read pcap and then it extracts all important (relevant) info. I don't want to just delete it, is there any way to decrypt it using rdpcap?
I found pyDot11 which seems to do what I want but there is no guide or example code for decrypting WPA. Can someone share the code for decrypting WPA?