merging the transmitter code from prototype that ran on laptop with one additional point : encrypt the msg len
merged code from testing laptops