Add an heuristic to detect fully encrypted flows (#2058)

A fully encrypted session is a flow where every bytes of the
payload is encrypted in an attempt to “look like nothing”.
The heuristic needs only the very first packet of the flow.
See: https://www.usenix.org/system/files/sec23fall-prepub-234-wu-mingshi.pdf

A basic, but generic, inplementation of the popcpunt alg has been added
This commit is contained in:
Ivan Nardi
2023-07-26 09:09:12 +02:00
committed by GitHub
parent 2b230e28e0
commit 3326fa258e
17 changed files with 280 additions and 105 deletions
+7
View File
@@ -1843,6 +1843,13 @@ extern "C" {
/* ******************************* */
/* PopCount [count how many bits are set to 1] */
int ndpi_popcount_init(struct ndpi_popcount *h);
void ndpi_popcount_count(struct ndpi_popcount *h, const u_int8_t *buf, u_int32_t buf_len);
/* ******************************* */
int ndpi_init_bin(struct ndpi_bin *b, enum ndpi_bin_family f, u_int16_t num_bins);
void ndpi_free_bin(struct ndpi_bin *b);
struct ndpi_bin* ndpi_clone_bin(struct ndpi_bin *b);