HMAC enabled Bloom filter and Scalable Bloom Filter
Provides an HMAC extension to the existing implementation. The filters now also have the possibility to use keyed hash functions.
My guess is you're trying to do something similar to what is outlined here? – https://www.uni-due.de/~hq0215/documents/Draft_Ottawa_Bloom.pdf
A couple of things are sticking out to me immediately:
- hashmac should be a boolean since it's a flag. But, this might be mitigated by...
- I'm thinking this functionality should be a subclass of the filter itself instead of a flag, e.g. HMACBloomFilter, etc.
What do you think?
Basically, one would wish to use hmac instead of hash function in a scenario where only specific entities have the right to insert elements in the filter or check for belonging in it. To this end, the entities may share a common secret key and generate hmac for each item. Similarly checking for belonging would require ownership of the key. Such a filter may prevent Denial-of-service attacks against certain services.
Indeed, a more cleaner code would be to create a subclass HMACBloomFilter which would have an attribute key.