Text this: Efficient attack detection and data aggregation algorithm