# How to hide bit frequency of the inter-packet delays covert channel?

I encode a hidden message as different delays between packets of another data stream.

My implementation now is that for each bit,

• if the bit is 0, a inter-packet delay between min and middle is generated and
• if the bit is 1, a inter-packet delay between middle and max is generated.

Here's my code in Python:

binary_string = ''
m_time = 0.5
min_time = 0.2
max_time = 0.9
csv_array = []
package_stream_array = []
last_timecode = 0
for c in secret:
binary_string += bin(ord(c))[2:].rjust(7,'0')
for key, digi in enumerate(binary_string):
if digi == '0':
last_timecode += uniform(min_time, m_time)
csv_array.append(last_timecode)
package_stream_array.append("p({0:d},{1:.2f})".format(key+1, last_timecode ))
elif digi == '1':
last_timecode += uniform(m_time,max_time)
package_stream_array.append("p({0:d},{1:.2f})".format(key+1, last_timecode))
csv_array.append(last_timecode)
for memeber in package_stream_array:
print memeber


After I plot a chart, I found the 0,1-frequency still can be observed.

Is there a better way to improve this?

-
What type of data are you encoding? Plain text? Are you looking for an encoding scheme for the data to be transmitted to make the variances look more random? – HeatfanJohn Oct 7 '12 at 2:27
@HeatfanJohn as shown in the code, I use plaintext encoding in ASCII. The direction I'm going to is improving how to map the bit 1 and 0 to the packet delay. The code is the second improvement, the first is use certain delay time to represent 1 and 0, like 0.3ms is bit 0 ', 0.6ms is bit 1`. which obviously raise suspicion, the chart will show only 2 hight, thus easily to be broken. So you can see what direction I'm heading into – mko Oct 7 '12 at 4:19