ScrambleSuit should delay packet morphing till the moment the packet gets sent
From looking at the ScrambleSuit code in phw's github repository, it looks like ScrambleSuit's packet morpher and IAT interact like thus:
- In the receive callback
- Apply packet morphing for the length of the burst
- Add the burst's data to the IAT buffer
- Schedule a timer if not pending
- In the timer
- Send up to the MTU worth of data from the IAT buffer
- Reschedule the timer if data remains
This probably should be:
- In the receive callback
- Add the received data to the IAT buffer
- Schedule a timer if not pending
- In the timer
- Send up to the MTU worth of data from the IAT buffer
- If the IAT buffer is empty, send padding
- Reschedule the timer if data remains
The first implementation will send an amount of random padding corresponding to the number of times the receive callback was invoked during the IAT delay. The second implementation sends 1 PRD sample worth of padding per write.
It is possible that the bandwidth/obfuscation tradeoff is desirable (the current implementation will have a more varied amount of total data transferred), but the actual packet sizes on the wire should look equally random for either implementation.