mfontanini / libtins

High-level, multiplatform C++ network packet sniffing and crafting library.
http://libtins.github.io/
BSD 2-Clause "Simplified" License
1.91k stars 377 forks source link

CCMP Encryption for libtins #441

Open 3brahimi opened 3 years ago

3brahimi commented 3 years ago

I am trying to implement a CCMP encryption method for libtins. My goal is to perform a successful 4-way handshake and then start transmitting encrypted packets. Fortunately libtins implements the ccmp decrypter, but I am struggling with the ccmp encryption. I wonder if anyone has already implemented this?

I read the standard and studied other implementations (that are not based on libtins); yet, I couldn't get it right to the last detail such that it works. Any help, hints, or guidance is much appreciated.

mfontanini commented 3 years ago

That's a good question and definitely something I thought about implementing at some point. I don't really have any resources on this though. When I implemented the decryption, I used aircrack-ng's source code as a guide on what to do. That seemed fairly self explanatory. I haven't played with that tool suite in a while but it's possible there is some in there that you can use as reference.

Otherwise you may have to look at some other library or application, maybe wpa_supplicant? As a fallback you can use whatever IEEE standard defines this, but that'll take some extra effort.

3brahimi commented 3 years ago

Hey Matias, Thank you for the response. I just finished an implementation. Seems to work for some of your WPA2 Decrypter test cases. I would like to test it more and if you think it is worthy I can give it to you so you can incorporate it with our own design pattern into libtins. Regards